Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 276a58b

Browse files
committed
Merge from 3.2 . Replace the term members with correct and appropriate terminology. Initial patch by Adam Woodbeck.
2 parents 1945f93 + a6bac95 commit 276a58b

22 files changed

Lines changed: 127 additions & 125 deletions

Doc/library/cmd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ A :class:`Cmd` instance has the following methods:
5050
the line as argument.
5151

5252
The optional argument is a banner or intro string to be issued before the first
53-
prompt (this overrides the :attr:`intro` class member).
53+
prompt (this overrides the :attr:`intro` class attribute).
5454

5555
If the :mod:`readline` module is loaded, input will automatically inherit
5656
:program:`bash`\ -like history-list editing (e.g. :kbd:`Control-P` scrolls back

Doc/library/curses.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ You can instantiate a :class:`Textbox` object as follows:
16391639
each keystroke entered with the keystroke as a parameter; command dispatch
16401640
is done on the result. This method returns the window contents as a
16411641
string; whether blanks in the window are included is affected by the
1642-
:attr:`stripspaces` member.
1642+
:attr:`stripspaces` attribute.
16431643

16441644

16451645
.. method:: do_command(ch)
@@ -1711,7 +1711,7 @@ You can instantiate a :class:`Textbox` object as follows:
17111711

17121712
.. attribute:: stripspaces
17131713

1714-
This data member is a flag which controls the interpretation of blanks in
1714+
This attribute is a flag which controls the interpretation of blanks in
17151715
the window. When it is on, trailing blanks on each line are ignored; any
17161716
cursor motion that would land the cursor on a trailing blank goes to the
17171717
end of that line instead, and trailing blanks are stripped when the window

Doc/library/datetime.rst

Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
The :mod:`datetime` module supplies classes for manipulating dates and times in
1313
both simple and complex ways. While date and time arithmetic is supported, the
14-
focus of the implementation is on efficient member extraction for output
14+
focus of the implementation is on efficient attribute extraction for output
1515
formatting and manipulation. For related
1616
functionality, see also the :mod:`time` and :mod:`calendar` modules.
1717

@@ -25,7 +25,7 @@ miles, or mass. Naive :class:`datetime` objects are easy to understand and to
2525
work with, at the cost of ignoring some aspects of reality.
2626

2727
For applications requiring more, :class:`datetime` and :class:`time` objects
28-
have an optional time zone information member, :attr:`tzinfo`, that can contain
28+
have an optional time zone information attribute, :attr:`tzinfo`, that can contain
2929
an instance of a subclass of the abstract :class:`tzinfo` class. These
3030
:class:`tzinfo` objects capture information about the offset from UTC time, the
3131
time zone name, and whether Daylight Saving Time is in effect. Note that only
@@ -499,9 +499,9 @@ Instance methods:
499499

500500
.. method:: date.replace(year, month, day)
501501

502-
Return a date with the same value, except for those members given new values by
503-
whichever keyword arguments are specified. For example, if ``d == date(2002,
504-
12, 31)``, then ``d.replace(day=26) == date(2002, 12, 26)``.
502+
Return a date with the same value, except for those parameters given new
503+
values by whichever keyword arguments are specified. For example, if ``d ==
504+
date(2002, 12, 31)``, then ``d.replace(day=26) == date(2002, 12, 26)``.
505505

506506

507507
.. method:: date.timetuple()
@@ -748,11 +748,11 @@ Other constructors, all class methods:
748748

749749
.. classmethod:: datetime.combine(date, time)
750750

751-
Return a new :class:`datetime` object whose date members are equal to the given
752-
:class:`date` object's, and whose time and :attr:`tzinfo` members are equal to
753-
the given :class:`time` object's. For any :class:`datetime` object *d*, ``d ==
754-
datetime.combine(d.date(), d.timetz())``. If date is a :class:`datetime`
755-
object, its time and :attr:`tzinfo` members are ignored.
751+
Return a new :class:`datetime` object whose date attributes are equal to the
752+
given :class:`date` object's, and whose time and :attr:`tzinfo` attributes are
753+
equal to the given :class:`time` object's. For any :class:`datetime` object
754+
*d*, ``d == datetime.combine(d.date(), d.timetz())``. If date is a
755+
:class:`datetime` object, its time and :attr:`tzinfo` attributes are ignored.
756756

757757

758758
.. classmethod:: datetime.strptime(date_string, format)
@@ -846,43 +846,44 @@ Supported operations:
846846
(1)
847847
datetime2 is a duration of timedelta removed from datetime1, moving forward in
848848
time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. The
849-
result has the same :attr:`tzinfo` member as the input datetime, and datetime2 -
850-
datetime1 == timedelta after. :exc:`OverflowError` is raised if datetime2.year
851-
would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note
852-
that no time zone adjustments are done even if the input is an aware object.
849+
result has the same :attr:`tzinfo` attribute as the input datetime, and
850+
datetime2 - datetime1 == timedelta after. :exc:`OverflowError` is raised if
851+
datetime2.year would be smaller than :const:`MINYEAR` or larger than
852+
:const:`MAXYEAR`. Note that no time zone adjustments are done even if the
853+
input is an aware object.
853854

854855
(2)
855856
Computes the datetime2 such that datetime2 + timedelta == datetime1. As for
856-
addition, the result has the same :attr:`tzinfo` member as the input datetime,
857-
and no time zone adjustments are done even if the input is aware. This isn't
858-
quite equivalent to datetime1 + (-timedelta), because -timedelta in isolation
859-
can overflow in cases where datetime1 - timedelta does not.
857+
addition, the result has the same :attr:`tzinfo` attribute as the input
858+
datetime, and no time zone adjustments are done even if the input is aware.
859+
This isn't quite equivalent to datetime1 + (-timedelta), because -timedelta
860+
in isolation can overflow in cases where datetime1 - timedelta does not.
860861

861862
(3)
862863
Subtraction of a :class:`datetime` from a :class:`datetime` is defined only if
863864
both operands are naive, or if both are aware. If one is aware and the other is
864865
naive, :exc:`TypeError` is raised.
865866

866-
If both are naive, or both are aware and have the same :attr:`tzinfo` member,
867-
the :attr:`tzinfo` members are ignored, and the result is a :class:`timedelta`
867+
If both are naive, or both are aware and have the same :attr:`tzinfo` attribute,
868+
the :attr:`tzinfo` attributes are ignored, and the result is a :class:`timedelta`
868869
object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments
869870
are done in this case.
870871

871-
If both are aware and have different :attr:`tzinfo` members, ``a-b`` acts as if
872-
*a* and *b* were first converted to naive UTC datetimes first. The result is
873-
``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) -
874-
b.utcoffset())`` except that the implementation never overflows.
872+
If both are aware and have different :attr:`tzinfo` attributes, ``a-b`` acts
873+
as if *a* and *b* were first converted to naive UTC datetimes first. The
874+
result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None)
875+
- b.utcoffset())`` except that the implementation never overflows.
875876

876877
(4)
877878
*datetime1* is considered less than *datetime2* when *datetime1* precedes
878879
*datetime2* in time.
879880

880881
If one comparand is naive and the other is aware, :exc:`TypeError` is raised.
881-
If both comparands are aware, and have the same :attr:`tzinfo` member, the
882-
common :attr:`tzinfo` member is ignored and the base datetimes are compared. If
883-
both comparands are aware and have different :attr:`tzinfo` members, the
884-
comparands are first adjusted by subtracting their UTC offsets (obtained from
885-
``self.utcoffset()``).
882+
If both comparands are aware, and have the same :attr:`tzinfo` attribute, the
883+
common :attr:`tzinfo` attribute is ignored and the base datetimes are
884+
compared. If both comparands are aware and have different :attr:`tzinfo`
885+
attributes, the comparands are first adjusted by subtracting their UTC
886+
offsets (obtained from ``self.utcoffset()``).
886887

887888
.. note::
888889

@@ -915,41 +916,41 @@ Instance methods:
915916
.. method:: datetime.timetz()
916917

917918
Return :class:`time` object with same hour, minute, second, microsecond, and
918-
tzinfo members. See also method :meth:`time`.
919+
tzinfo attributes. See also method :meth:`time`.
919920

920921

921922
.. method:: datetime.replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]])
922923

923-
Return a datetime with the same members, except for those members given new
924-
values by whichever keyword arguments are specified. Note that ``tzinfo=None``
925-
can be specified to create a naive datetime from an aware datetime with no
926-
conversion of date and time members.
924+
Return a datetime with the same attributes, except for those attributes given
925+
new values by whichever keyword arguments are specified. Note that
926+
``tzinfo=None`` can be specified to create a naive datetime from an aware
927+
datetime with no conversion of date and time attributes.
927928

928929

929930
.. method:: datetime.astimezone(tz)
930931

931-
Return a :class:`datetime` object with new :attr:`tzinfo` member *tz*, adjusting
932-
the date and time members so the result is the same UTC time as *self*, but in
933-
*tz*'s local time.
932+
Return a :class:`datetime` object with new :attr:`tzinfo` attribute *tz*,
933+
adjusting the date and time attributes so the result is the same UTC time as
934+
*self*, but in *tz*'s local time.
934935

935936
*tz* must be an instance of a :class:`tzinfo` subclass, and its
936937
:meth:`utcoffset` and :meth:`dst` methods must not return ``None``. *self* must
937938
be aware (``self.tzinfo`` must not be ``None``, and ``self.utcoffset()`` must
938939
not return ``None``).
939940

940941
If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no
941-
adjustment of date or time members is performed. Else the result is local time
942-
in time zone *tz*, representing the same UTC time as *self*: after ``astz =
943-
dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will usually have the same date
944-
and time members as ``dt - dt.utcoffset()``. The discussion of class
945-
:class:`tzinfo` explains the cases at Daylight Saving Time transition boundaries
946-
where this cannot be achieved (an issue only if *tz* models both standard and
947-
daylight time).
942+
adjustment of date or time attributes is performed. Else the result is local
943+
time in time zone *tz*, representing the same UTC time as *self*: after
944+
``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will usually have
945+
the same date and time attributes as ``dt - dt.utcoffset()``. The discussion
946+
of class :class:`tzinfo` explains the cases at Daylight Saving Time transition
947+
boundaries where this cannot be achieved (an issue only if *tz* models both
948+
standard and daylight time).
948949

949950
If you merely want to attach a time zone object *tz* to a datetime *dt* without
950-
adjustment of date and time members, use ``dt.replace(tzinfo=tz)``. If you
951+
adjustment of date and time attributes, use ``dt.replace(tzinfo=tz)``. If you
951952
merely want to remove the time zone object from an aware datetime *dt* without
952-
conversion of date and time members, use ``dt.replace(tzinfo=None)``.
953+
conversion of date and time attributes, use ``dt.replace(tzinfo=None)``.
953954

954955
Note that the default :meth:`tzinfo.fromutc` method can be overridden in a
955956
:class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`.
@@ -1260,14 +1261,14 @@ Supported operations:
12601261
* comparison of :class:`time` to :class:`time`, where *a* is considered less
12611262
than *b* when *a* precedes *b* in time. If one comparand is naive and the other
12621263
is aware, :exc:`TypeError` is raised. If both comparands are aware, and have
1263-
the same :attr:`tzinfo` member, the common :attr:`tzinfo` member is ignored and
1264-
the base times are compared. If both comparands are aware and have different
1265-
:attr:`tzinfo` members, the comparands are first adjusted by subtracting their
1266-
UTC offsets (obtained from ``self.utcoffset()``). In order to stop mixed-type
1267-
comparisons from falling back to the default comparison by object address, when
1268-
a :class:`time` object is compared to an object of a different type,
1269-
:exc:`TypeError` is raised unless the comparison is ``==`` or ``!=``. The
1270-
latter cases return :const:`False` or :const:`True`, respectively.
1264+
the same :attr:`tzinfo` attribute, the common :attr:`tzinfo` attribute is
1265+
ignored and the base times are compared. If both comparands are aware and
1266+
have different :attr:`tzinfo` attributes, the comparands are first adjusted by
1267+
subtracting their UTC offsets (obtained from ``self.utcoffset()``). In order
1268+
to stop mixed-type comparisons from falling back to the default comparison by
1269+
object address, when a :class:`time` object is compared to an object of a
1270+
different type, :exc:`TypeError` is raised unless the comparison is ``==`` or
1271+
``!=``. The latter cases return :const:`False` or :const:`True`, respectively.
12711272

12721273
* hash, use as dict key
12731274

@@ -1282,10 +1283,10 @@ Instance methods:
12821283

12831284
.. method:: time.replace([hour[, minute[, second[, microsecond[, tzinfo]]]]])
12841285

1285-
Return a :class:`time` with the same value, except for those members given new
1286-
values by whichever keyword arguments are specified. Note that ``tzinfo=None``
1287-
can be specified to create a naive :class:`time` from an aware :class:`time`,
1288-
without conversion of the time members.
1286+
Return a :class:`time` with the same value, except for those attributes given
1287+
new values by whichever keyword arguments are specified. Note that
1288+
``tzinfo=None`` can be specified to create a naive :class:`time` from an
1289+
aware :class:`time`, without conversion of the time attributes.
12891290

12901291

12911292
.. method:: time.isoformat()
@@ -1370,7 +1371,7 @@ EDT.
13701371

13711372
An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the
13721373
constructors for :class:`datetime` and :class:`time` objects. The latter objects
1373-
view their members as being in local time, and the :class:`tzinfo` object
1374+
view their attributes as being in local time, and the :class:`tzinfo` object
13741375
supports methods revealing offset of local time from UTC, the name of the time
13751376
zone, and DST offset, all relative to a date or time object passed to them.
13761377

@@ -1415,9 +1416,9 @@ methods. Exactly which methods are needed depends on the uses made of aware
14151416
already been added to the UTC offset returned by :meth:`utcoffset`, so there's
14161417
no need to consult :meth:`dst` unless you're interested in obtaining DST info
14171418
separately. For example, :meth:`datetime.timetuple` calls its :attr:`tzinfo`
1418-
member's :meth:`dst` method to determine how the :attr:`tm_isdst` flag should be
1419-
set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes
1420-
when crossing time zones.
1419+
attribute's :meth:`dst` method to determine how the :attr:`tm_isdst` flag
1420+
should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for
1421+
DST changes when crossing time zones.
14211422

14221423
An instance *tz* of a :class:`tzinfo` subclass that models both standard and
14231424
daylight times must be consistent in this sense:
@@ -1493,10 +1494,10 @@ There is one more :class:`tzinfo` method that a subclass may wish to override:
14931494
.. method:: tzinfo.fromutc(dt)
14941495

14951496
This is called from the default :class:`datetime.astimezone()` implementation.
1496-
When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time members
1497-
are to be viewed as expressing a UTC time. The purpose of :meth:`fromutc` is to
1498-
adjust the date and time members, returning an equivalent datetime in *self*'s
1499-
local time.
1497+
When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time
1498+
attributes are to be viewed as expressing a UTC time. The purpose of
1499+
:meth:`fromutc` is to adjust the date and time attributes, returning an
1500+
equivalent datetime in *self*'s local time.
15001501

15011502
Most :class:`tzinfo` subclasses should be able to inherit the default
15021503
:meth:`fromutc` implementation without problems. It's strong enough to handle

Doc/library/decimal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ Decimal objects
654654

655655
Normalize the number by stripping the rightmost trailing zeros and
656656
converting any result equal to :const:`Decimal('0')` to
657-
:const:`Decimal('0e0')`. Used for producing canonical values for members
657+
:const:`Decimal('0e0')`. Used for producing canonical values for attributes
658658
of an equivalence class. For example, ``Decimal('32.100')`` and
659659
``Decimal('0.321000e+2')`` both normalize to the equivalent value
660660
``Decimal('32.1')``.

Doc/library/doctest.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,11 +1127,10 @@ DocTest Objects
11271127
.. class:: DocTest(examples, globs, name, filename, lineno, docstring)
11281128

11291129
A collection of doctest examples that should be run in a single namespace. The
1130-
constructor arguments are used to initialize the member variables of the same
1131-
names.
1130+
constructor arguments are used to initialize the attributes of the same names.
11321131

11331132

1134-
:class:`DocTest` defines the following member variables. They are initialized by
1133+
:class:`DocTest` defines the following attributes. They are initialized by
11351134
the constructor, and should not be modified directly.
11361135

11371136

@@ -1184,11 +1183,11 @@ Example Objects
11841183
.. class:: Example(source, want, exc_msg=None, lineno=0, indent=0, options=None)
11851184

11861185
A single interactive example, consisting of a Python statement and its expected
1187-
output. The constructor arguments are used to initialize the member variables
1188-
of the same names.
1186+
output. The constructor arguments are used to initialize the attributes of
1187+
the same names.
11891188

11901189

1191-
:class:`Example` defines the following member variables. They are initialized by
1190+
:class:`Example` defines the following attributes. They are initialized by
11921191
the constructor, and should not be modified directly.
11931192

11941193

@@ -1675,9 +1674,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances:
16751674

16761675
An exception raised by :class:`DocTestRunner` to signal that a doctest example's
16771676
actual output did not match its expected output. The constructor arguments are
1678-
used to initialize the member variables of the same names.
1677+
used to initialize the attributes of the same names.
16791678

1680-
:exc:`DocTestFailure` defines the following member variables:
1679+
:exc:`DocTestFailure` defines the following attributes:
16811680

16821681

16831682
.. attribute:: DocTestFailure.test
@@ -1699,9 +1698,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances:
16991698

17001699
An exception raised by :class:`DocTestRunner` to signal that a doctest
17011700
example raised an unexpected exception. The constructor arguments are used
1702-
to initialize the member variables of the same names.
1701+
to initialize the attributes of the same names.
17031702

1704-
:exc:`UnexpectedException` defines the following member variables:
1703+
:exc:`UnexpectedException` defines the following attributes:
17051704

17061705

17071706
.. attribute:: UnexpectedException.test

Doc/library/gzip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The module defines the following items:
6161
time is used. This module ignores the timestamp when decompressing;
6262
however, some programs, such as :program:`gunzip`\ , make use of it.
6363
The format of the timestamp is the same as that of the return value of
64-
``time.time()`` and of the ``st_mtime`` member of the object returned
64+
``time.time()`` and of the ``st_mtime`` attribute of the object returned
6565
by ``os.stat()``.
6666

6767
Calling a :class:`GzipFile` object's :meth:`close` method does not close

Doc/library/html.entities.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
1313
and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs`
14-
member of the :class:`html.parser.HTMLParser` class. The definition provided
14+
attribute of the :class:`html.parser.HTMLParser` class. The definition provided
1515
here contains all the entities defined by XHTML 1.0 that can be handled using
1616
simple textual substitution in the Latin-1 character set (ISO-8859-1).
1717

Doc/library/http.cookies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Morsel Objects
152152

153153
.. method:: Morsel.set(key, value, coded_value)
154154

155-
Set the *key*, *value* and *coded_value* members.
155+
Set the *key*, *value* and *coded_value* attributes.
156156

157157

158158
.. method:: Morsel.isReservedKey(K)

Doc/library/io.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ I/O Base Classes
391391
:class:`RawIOBase` implementation, but wrap one, like
392392
:class:`BufferedWriter` and :class:`BufferedReader` do.
393393

394-
:class:`BufferedIOBase` provides or overrides these members in addition to
395-
those from :class:`IOBase`:
394+
:class:`BufferedIOBase` provides or overrides these methods and attribute in
395+
addition to those from :class:`IOBase`:
396396

397397
.. attribute:: raw
398398

0 commit comments

Comments
 (0)