Kaydet (Commit) a6bac95a authored tarafından Senthil Kumaran's avatar Senthil Kumaran

issue10403 - Let's not use members anymore. Use 'attribute' where it denotes…

issue10403 - Let's not use members anymore. Use 'attribute' where it denotes attribute and 'methods' where it denotes methods. Context should clarify usage.
üst bfd1edd1
...@@ -50,7 +50,7 @@ A :class:`Cmd` instance has the following methods: ...@@ -50,7 +50,7 @@ A :class:`Cmd` instance has the following methods:
the line as argument. the line as argument.
The optional argument is a banner or intro string to be issued before the first The optional argument is a banner or intro string to be issued before the first
prompt (this overrides the :attr:`intro` class member). prompt (this overrides the :attr:`intro` class attribute).
If the :mod:`readline` module is loaded, input will automatically inherit If the :mod:`readline` module is loaded, input will automatically inherit
:program:`bash`\ -like history-list editing (e.g. :kbd:`Control-P` scrolls back :program:`bash`\ -like history-list editing (e.g. :kbd:`Control-P` scrolls back
......
...@@ -1639,7 +1639,7 @@ You can instantiate a :class:`Textbox` object as follows: ...@@ -1639,7 +1639,7 @@ You can instantiate a :class:`Textbox` object as follows:
each keystroke entered with the keystroke as a parameter; command dispatch each keystroke entered with the keystroke as a parameter; command dispatch
is done on the result. This method returns the window contents as a is done on the result. This method returns the window contents as a
string; whether blanks in the window are included is affected by the string; whether blanks in the window are included is affected by the
:attr:`stripspaces` member. :attr:`stripspaces` attribute.
.. method:: do_command(ch) .. method:: do_command(ch)
...@@ -1711,7 +1711,7 @@ You can instantiate a :class:`Textbox` object as follows: ...@@ -1711,7 +1711,7 @@ You can instantiate a :class:`Textbox` object as follows:
.. attribute:: stripspaces .. attribute:: stripspaces
This data member is a flag which controls the interpretation of blanks in This attribute is a flag which controls the interpretation of blanks in
the window. When it is on, trailing blanks on each line are ignored; any the window. When it is on, trailing blanks on each line are ignored; any
cursor motion that would land the cursor on a trailing blank goes to the cursor motion that would land the cursor on a trailing blank goes to the
end of that line instead, and trailing blanks are stripped when the window end of that line instead, and trailing blanks are stripped when the window
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
The :mod:`datetime` module supplies classes for manipulating dates and times in The :mod:`datetime` module supplies classes for manipulating dates and times in
both simple and complex ways. While date and time arithmetic is supported, the both simple and complex ways. While date and time arithmetic is supported, the
focus of the implementation is on efficient member extraction for output focus of the implementation is on efficient attribute extraction for output
formatting and manipulation. For related formatting and manipulation. For related
functionality, see also the :mod:`time` and :mod:`calendar` modules. functionality, see also the :mod:`time` and :mod:`calendar` modules.
...@@ -25,7 +25,7 @@ miles, or mass. Naive :class:`datetime` objects are easy to understand and to ...@@ -25,7 +25,7 @@ miles, or mass. Naive :class:`datetime` objects are easy to understand and to
work with, at the cost of ignoring some aspects of reality. work with, at the cost of ignoring some aspects of reality.
For applications requiring more, :class:`datetime` and :class:`time` objects For applications requiring more, :class:`datetime` and :class:`time` objects
have an optional time zone information member, :attr:`tzinfo`, that can contain have an optional time zone information attribute, :attr:`tzinfo`, that can contain
an instance of a subclass of the abstract :class:`tzinfo` class. These an instance of a subclass of the abstract :class:`tzinfo` class. These
:class:`tzinfo` objects capture information about the offset from UTC time, the :class:`tzinfo` objects capture information about the offset from UTC time, the
time zone name, and whether Daylight Saving Time is in effect. Note that only time zone name, and whether Daylight Saving Time is in effect. Note that only
...@@ -499,9 +499,9 @@ Instance methods: ...@@ -499,9 +499,9 @@ Instance methods:
.. method:: date.replace(year, month, day) .. method:: date.replace(year, month, day)
Return a date with the same value, except for those members given new values by Return a date with the same value, except for those parameters given new
whichever keyword arguments are specified. For example, if ``d == date(2002, values by whichever keyword arguments are specified. For example, if ``d ==
12, 31)``, then ``d.replace(day=26) == date(2002, 12, 26)``. date(2002, 12, 31)``, then ``d.replace(day=26) == date(2002, 12, 26)``.
.. method:: date.timetuple() .. method:: date.timetuple()
...@@ -732,11 +732,11 @@ Other constructors, all class methods: ...@@ -732,11 +732,11 @@ Other constructors, all class methods:
.. classmethod:: datetime.combine(date, time) .. classmethod:: datetime.combine(date, time)
Return a new :class:`datetime` object whose date members are equal to the given Return a new :class:`datetime` object whose date attributes are equal to the
:class:`date` object's, and whose time and :attr:`tzinfo` members are equal to given :class:`date` object's, and whose time and :attr:`tzinfo` attributes are
the given :class:`time` object's. For any :class:`datetime` object *d*, ``d == equal to the given :class:`time` object's. For any :class:`datetime` object
datetime.combine(d.date(), d.timetz())``. If date is a :class:`datetime` *d*, ``d == datetime.combine(d.date(), d.timetz())``. If date is a
object, its time and :attr:`tzinfo` members are ignored. :class:`datetime` object, its time and :attr:`tzinfo` attributes are ignored.
.. classmethod:: datetime.strptime(date_string, format) .. classmethod:: datetime.strptime(date_string, format)
...@@ -830,43 +830,44 @@ Supported operations: ...@@ -830,43 +830,44 @@ Supported operations:
(1) (1)
datetime2 is a duration of timedelta removed from datetime1, moving forward in datetime2 is a duration of timedelta removed from datetime1, moving forward in
time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. The time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. The
result has the same :attr:`tzinfo` member as the input datetime, and datetime2 - result has the same :attr:`tzinfo` attribute as the input datetime, and
datetime1 == timedelta after. :exc:`OverflowError` is raised if datetime2.year datetime2 - datetime1 == timedelta after. :exc:`OverflowError` is raised if
would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note datetime2.year would be smaller than :const:`MINYEAR` or larger than
that no time zone adjustments are done even if the input is an aware object. :const:`MAXYEAR`. Note that no time zone adjustments are done even if the
input is an aware object.
(2) (2)
Computes the datetime2 such that datetime2 + timedelta == datetime1. As for Computes the datetime2 such that datetime2 + timedelta == datetime1. As for
addition, the result has the same :attr:`tzinfo` member as the input datetime, addition, the result has the same :attr:`tzinfo` attribute as the input
and no time zone adjustments are done even if the input is aware. This isn't datetime, and no time zone adjustments are done even if the input is aware.
quite equivalent to datetime1 + (-timedelta), because -timedelta in isolation This isn't quite equivalent to datetime1 + (-timedelta), because -timedelta
can overflow in cases where datetime1 - timedelta does not. in isolation can overflow in cases where datetime1 - timedelta does not.
(3) (3)
Subtraction of a :class:`datetime` from a :class:`datetime` is defined only if Subtraction of a :class:`datetime` from a :class:`datetime` is defined only if
both operands are naive, or if both are aware. If one is aware and the other is both operands are naive, or if both are aware. If one is aware and the other is
naive, :exc:`TypeError` is raised. naive, :exc:`TypeError` is raised.
If both are naive, or both are aware and have the same :attr:`tzinfo` member, If both are naive, or both are aware and have the same :attr:`tzinfo` attribute,
the :attr:`tzinfo` members are ignored, and the result is a :class:`timedelta` the :attr:`tzinfo` attributes are ignored, and the result is a :class:`timedelta`
object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments
are done in this case. are done in this case.
If both are aware and have different :attr:`tzinfo` members, ``a-b`` acts as if If both are aware and have different :attr:`tzinfo` attributes, ``a-b`` acts
*a* and *b* were first converted to naive UTC datetimes first. The result is as if *a* and *b* were first converted to naive UTC datetimes first. The
``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None)
b.utcoffset())`` except that the implementation never overflows. - b.utcoffset())`` except that the implementation never overflows.
(4) (4)
*datetime1* is considered less than *datetime2* when *datetime1* precedes *datetime1* is considered less than *datetime2* when *datetime1* precedes
*datetime2* in time. *datetime2* in time.
If one comparand is naive and the other is aware, :exc:`TypeError` is raised. If one comparand is naive and the other is aware, :exc:`TypeError` is raised.
If both comparands are aware, and have the same :attr:`tzinfo` member, the If both comparands are aware, and have the same :attr:`tzinfo` attribute, the
common :attr:`tzinfo` member is ignored and the base datetimes are compared. If common :attr:`tzinfo` attribute is ignored and the base datetimes are
both comparands are aware and have different :attr:`tzinfo` members, the compared. If both comparands are aware and have different :attr:`tzinfo`
comparands are first adjusted by subtracting their UTC offsets (obtained from attributes, the comparands are first adjusted by subtracting their UTC
``self.utcoffset()``). offsets (obtained from ``self.utcoffset()``).
.. note:: .. note::
...@@ -899,22 +900,22 @@ Instance methods: ...@@ -899,22 +900,22 @@ Instance methods:
.. method:: datetime.timetz() .. method:: datetime.timetz()
Return :class:`time` object with same hour, minute, second, microsecond, and Return :class:`time` object with same hour, minute, second, microsecond, and
tzinfo members. See also method :meth:`time`. tzinfo attributes. See also method :meth:`time`.
.. method:: datetime.replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]]) .. method:: datetime.replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]])
Return a datetime with the same members, except for those members given new Return a datetime with the same attributes, except for those attributes given
values by whichever keyword arguments are specified. Note that ``tzinfo=None`` new values by whichever keyword arguments are specified. Note that
can be specified to create a naive datetime from an aware datetime with no ``tzinfo=None`` can be specified to create a naive datetime from an aware
conversion of date and time members. datetime with no conversion of date and time attributes.
.. method:: datetime.astimezone(tz) .. method:: datetime.astimezone(tz)
Return a :class:`datetime` object with new :attr:`tzinfo` member *tz*, adjusting Return a :class:`datetime` object with new :attr:`tzinfo` attribute *tz*,
the date and time members so the result is the same UTC time as *self*, but in adjusting the date and time attributes so the result is the same UTC time as
*tz*'s local time. *self*, but in *tz*'s local time.
*tz* must be an instance of a :class:`tzinfo` subclass, and its *tz* must be an instance of a :class:`tzinfo` subclass, and its
:meth:`utcoffset` and :meth:`dst` methods must not return ``None``. *self* must :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. *self* must
...@@ -922,18 +923,18 @@ Instance methods: ...@@ -922,18 +923,18 @@ Instance methods:
not return ``None``). not return ``None``).
If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no
adjustment of date or time members is performed. Else the result is local time adjustment of date or time attributes is performed. Else the result is local
in time zone *tz*, representing the same UTC time as *self*: after ``astz = time in time zone *tz*, representing the same UTC time as *self*: after
dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will usually have the same date ``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will usually have
and time members as ``dt - dt.utcoffset()``. The discussion of class the same date and time attributes as ``dt - dt.utcoffset()``. The discussion
:class:`tzinfo` explains the cases at Daylight Saving Time transition boundaries of class :class:`tzinfo` explains the cases at Daylight Saving Time transition
where this cannot be achieved (an issue only if *tz* models both standard and boundaries where this cannot be achieved (an issue only if *tz* models both
daylight time). standard and daylight time).
If you merely want to attach a time zone object *tz* to a datetime *dt* without If you merely want to attach a time zone object *tz* to a datetime *dt* without
adjustment of date and time members, use ``dt.replace(tzinfo=tz)``. If you adjustment of date and time attributes, use ``dt.replace(tzinfo=tz)``. If you
merely want to remove the time zone object from an aware datetime *dt* without merely want to remove the time zone object from an aware datetime *dt* without
conversion of date and time members, use ``dt.replace(tzinfo=None)``. conversion of date and time attributes, use ``dt.replace(tzinfo=None)``.
Note that the default :meth:`tzinfo.fromutc` method can be overridden in a Note that the default :meth:`tzinfo.fromutc` method can be overridden in a
:class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. :class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`.
...@@ -1244,14 +1245,14 @@ Supported operations: ...@@ -1244,14 +1245,14 @@ Supported operations:
* comparison of :class:`time` to :class:`time`, where *a* is considered less * comparison of :class:`time` to :class:`time`, where *a* is considered less
than *b* when *a* precedes *b* in time. If one comparand is naive and the other than *b* when *a* precedes *b* in time. If one comparand is naive and the other
is aware, :exc:`TypeError` is raised. If both comparands are aware, and have is aware, :exc:`TypeError` is raised. If both comparands are aware, and have
the same :attr:`tzinfo` member, the common :attr:`tzinfo` member is ignored and the same :attr:`tzinfo` attribute, the common :attr:`tzinfo` attribute is
the base times are compared. If both comparands are aware and have different ignored and the base times are compared. If both comparands are aware and
:attr:`tzinfo` members, the comparands are first adjusted by subtracting their have different :attr:`tzinfo` attributes, the comparands are first adjusted by
UTC offsets (obtained from ``self.utcoffset()``). In order to stop mixed-type subtracting their UTC offsets (obtained from ``self.utcoffset()``). In order
comparisons from falling back to the default comparison by object address, when to stop mixed-type comparisons from falling back to the default comparison by
a :class:`time` object is compared to an object of a different type, object address, when a :class:`time` object is compared to an object of a
:exc:`TypeError` is raised unless the comparison is ``==`` or ``!=``. The different type, :exc:`TypeError` is raised unless the comparison is ``==`` or
latter cases return :const:`False` or :const:`True`, respectively. ``!=``. The latter cases return :const:`False` or :const:`True`, respectively.
* hash, use as dict key * hash, use as dict key
...@@ -1266,10 +1267,10 @@ Instance methods: ...@@ -1266,10 +1267,10 @@ Instance methods:
.. method:: time.replace([hour[, minute[, second[, microsecond[, tzinfo]]]]]) .. method:: time.replace([hour[, minute[, second[, microsecond[, tzinfo]]]]])
Return a :class:`time` with the same value, except for those members given new Return a :class:`time` with the same value, except for those attributes given
values by whichever keyword arguments are specified. Note that ``tzinfo=None`` new values by whichever keyword arguments are specified. Note that
can be specified to create a naive :class:`time` from an aware :class:`time`, ``tzinfo=None`` can be specified to create a naive :class:`time` from an
without conversion of the time members. aware :class:`time`, without conversion of the time attributes.
.. method:: time.isoformat() .. method:: time.isoformat()
...@@ -1354,7 +1355,7 @@ EDT. ...@@ -1354,7 +1355,7 @@ EDT.
An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the
constructors for :class:`datetime` and :class:`time` objects. The latter objects constructors for :class:`datetime` and :class:`time` objects. The latter objects
view their members as being in local time, and the :class:`tzinfo` object view their attributes as being in local time, and the :class:`tzinfo` object
supports methods revealing offset of local time from UTC, the name of the time supports methods revealing offset of local time from UTC, the name of the time
zone, and DST offset, all relative to a date or time object passed to them. zone, and DST offset, all relative to a date or time object passed to them.
...@@ -1399,9 +1400,9 @@ methods. Exactly which methods are needed depends on the uses made of aware ...@@ -1399,9 +1400,9 @@ methods. Exactly which methods are needed depends on the uses made of aware
already been added to the UTC offset returned by :meth:`utcoffset`, so there's already been added to the UTC offset returned by :meth:`utcoffset`, so there's
no need to consult :meth:`dst` unless you're interested in obtaining DST info no need to consult :meth:`dst` unless you're interested in obtaining DST info
separately. For example, :meth:`datetime.timetuple` calls its :attr:`tzinfo` separately. For example, :meth:`datetime.timetuple` calls its :attr:`tzinfo`
member's :meth:`dst` method to determine how the :attr:`tm_isdst` flag should be attribute's :meth:`dst` method to determine how the :attr:`tm_isdst` flag
set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for
when crossing time zones. DST changes when crossing time zones.
An instance *tz* of a :class:`tzinfo` subclass that models both standard and An instance *tz* of a :class:`tzinfo` subclass that models both standard and
daylight times must be consistent in this sense: daylight times must be consistent in this sense:
...@@ -1477,10 +1478,10 @@ There is one more :class:`tzinfo` method that a subclass may wish to override: ...@@ -1477,10 +1478,10 @@ There is one more :class:`tzinfo` method that a subclass may wish to override:
.. method:: tzinfo.fromutc(dt) .. method:: tzinfo.fromutc(dt)
This is called from the default :class:`datetime.astimezone()` implementation. This is called from the default :class:`datetime.astimezone()` implementation.
When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time members When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time
are to be viewed as expressing a UTC time. The purpose of :meth:`fromutc` is to attributes are to be viewed as expressing a UTC time. The purpose of
adjust the date and time members, returning an equivalent datetime in *self*'s :meth:`fromutc` is to adjust the date and time attributes, returning an
local time. equivalent datetime in *self*'s local time.
Most :class:`tzinfo` subclasses should be able to inherit the default Most :class:`tzinfo` subclasses should be able to inherit the default
:meth:`fromutc` implementation without problems. It's strong enough to handle :meth:`fromutc` implementation without problems. It's strong enough to handle
......
...@@ -654,7 +654,7 @@ Decimal objects ...@@ -654,7 +654,7 @@ Decimal objects
Normalize the number by stripping the rightmost trailing zeros and Normalize the number by stripping the rightmost trailing zeros and
converting any result equal to :const:`Decimal('0')` to converting any result equal to :const:`Decimal('0')` to
:const:`Decimal('0e0')`. Used for producing canonical values for members :const:`Decimal('0e0')`. Used for producing canonical values for attributes
of an equivalence class. For example, ``Decimal('32.100')`` and of an equivalence class. For example, ``Decimal('32.100')`` and
``Decimal('0.321000e+2')`` both normalize to the equivalent value ``Decimal('0.321000e+2')`` both normalize to the equivalent value
``Decimal('32.1')``. ``Decimal('32.1')``.
......
...@@ -1127,11 +1127,10 @@ DocTest Objects ...@@ -1127,11 +1127,10 @@ DocTest Objects
.. class:: DocTest(examples, globs, name, filename, lineno, docstring) .. class:: DocTest(examples, globs, name, filename, lineno, docstring)
A collection of doctest examples that should be run in a single namespace. The A collection of doctest examples that should be run in a single namespace. The
constructor arguments are used to initialize the member variables of the same constructor arguments are used to initialize the attributes of the same names.
names.
:class:`DocTest` defines the following member variables. They are initialized by :class:`DocTest` defines the following attributes. They are initialized by
the constructor, and should not be modified directly. the constructor, and should not be modified directly.
...@@ -1184,11 +1183,11 @@ Example Objects ...@@ -1184,11 +1183,11 @@ Example Objects
.. class:: Example(source, want, exc_msg=None, lineno=0, indent=0, options=None) .. class:: Example(source, want, exc_msg=None, lineno=0, indent=0, options=None)
A single interactive example, consisting of a Python statement and its expected A single interactive example, consisting of a Python statement and its expected
output. The constructor arguments are used to initialize the member variables output. The constructor arguments are used to initialize the attributes of
of the same names. the same names.
:class:`Example` defines the following member variables. They are initialized by :class:`Example` defines the following attributes. They are initialized by
the constructor, and should not be modified directly. the constructor, and should not be modified directly.
...@@ -1675,9 +1674,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances: ...@@ -1675,9 +1674,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances:
An exception raised by :class:`DocTestRunner` to signal that a doctest example's An exception raised by :class:`DocTestRunner` to signal that a doctest example's
actual output did not match its expected output. The constructor arguments are actual output did not match its expected output. The constructor arguments are
used to initialize the member variables of the same names. used to initialize the attributes of the same names.
:exc:`DocTestFailure` defines the following member variables: :exc:`DocTestFailure` defines the following attributes:
.. attribute:: DocTestFailure.test .. attribute:: DocTestFailure.test
...@@ -1699,9 +1698,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances: ...@@ -1699,9 +1698,9 @@ There are two exceptions that may be raised by :class:`DebugRunner` instances:
An exception raised by :class:`DocTestRunner` to signal that a doctest An exception raised by :class:`DocTestRunner` to signal that a doctest
example raised an unexpected exception. The constructor arguments are used example raised an unexpected exception. The constructor arguments are used
to initialize the member variables of the same names. to initialize the attributes of the same names.
:exc:`UnexpectedException` defines the following member variables: :exc:`UnexpectedException` defines the following attributes:
.. attribute:: UnexpectedException.test .. attribute:: UnexpectedException.test
......
...@@ -61,7 +61,7 @@ The module defines the following items: ...@@ -61,7 +61,7 @@ The module defines the following items:
time is used. This module ignores the timestamp when decompressing; time is used. This module ignores the timestamp when decompressing;
however, some programs, such as :program:`gunzip`\ , make use of it. however, some programs, such as :program:`gunzip`\ , make use of it.
The format of the timestamp is the same as that of the return value of The format of the timestamp is the same as that of the return value of
``time.time()`` and of the ``st_mtime`` member of the object returned ``time.time()`` and of the ``st_mtime`` attribute of the object returned
by ``os.stat()``. by ``os.stat()``.
Calling a :class:`GzipFile` object's :meth:`close` method does not close Calling a :class:`GzipFile` object's :meth:`close` method does not close
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``, This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs` and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs`
member of the :class:`html.parser.HTMLParser` class. The definition provided attribute of the :class:`html.parser.HTMLParser` class. The definition provided
here contains all the entities defined by XHTML 1.0 that can be handled using here contains all the entities defined by XHTML 1.0 that can be handled using
simple textual substitution in the Latin-1 character set (ISO-8859-1). simple textual substitution in the Latin-1 character set (ISO-8859-1).
......
...@@ -152,7 +152,7 @@ Morsel Objects ...@@ -152,7 +152,7 @@ Morsel Objects
.. method:: Morsel.set(key, value, coded_value) .. method:: Morsel.set(key, value, coded_value)
Set the *key*, *value* and *coded_value* members. Set the *key*, *value* and *coded_value* attributes.
.. method:: Morsel.isReservedKey(K) .. method:: Morsel.isReservedKey(K)
......
...@@ -391,8 +391,8 @@ I/O Base Classes ...@@ -391,8 +391,8 @@ I/O Base Classes
:class:`RawIOBase` implementation, but wrap one, like :class:`RawIOBase` implementation, but wrap one, like
:class:`BufferedWriter` and :class:`BufferedReader` do. :class:`BufferedWriter` and :class:`BufferedReader` do.
:class:`BufferedIOBase` provides or overrides these members in addition to :class:`BufferedIOBase` provides or overrides these methods and attribute in
those from :class:`IOBase`: addition to those from :class:`IOBase`:
.. attribute:: raw .. attribute:: raw
......
...@@ -394,7 +394,7 @@ tuples or objects that the method normally returns will be empty. ...@@ -394,7 +394,7 @@ tuples or objects that the method normally returns will be empty.
Send an ``ARTICLE`` command, where *message_spec* has the same meaning as Send an ``ARTICLE`` command, where *message_spec* has the same meaning as
for :meth:`stat`. Return a tuple ``(response, info)`` where *info* for :meth:`stat`. Return a tuple ``(response, info)`` where *info*
is a :class:`~collections.namedtuple` with three members *number*, is a :class:`~collections.namedtuple` with three attributes *number*,
*message_id* and *lines* (in that order). *number* is the article number *message_id* and *lines* (in that order). *number* is the article number
in the group (or 0 if the information is not available), *message_id* the in the group (or 0 if the information is not available), *message_id* the
message id as a string, and *lines* a list of lines (without terminating message id as a string, and *lines* a list of lines (without terminating
......
...@@ -1339,11 +1339,12 @@ Files and Directories ...@@ -1339,11 +1339,12 @@ Files and Directories
.. note:: .. note::
The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, and The exact meaning and resolution of the :attr:`st_atime`,
:attr:`st_ctime` members depends on the operating system and the file system. :attr:`st_mtime`, and :attr:`st_ctime` attributes depend on the operating
For example, on Windows systems using the FAT or FAT32 file systems, system and the file system. For example, on Windows systems using the FAT
:attr:`st_mtime` has 2-second resolution, and :attr:`st_atime` has only 1-day or FAT32 file systems, :attr:`st_mtime` has 2-second resolution, and
resolution. See your operating system documentation for details. :attr:`st_atime` has only 1-day resolution. See your operating system
documentation for details.
For backward compatibility, the return value of :func:`~os.stat` is also accessible For backward compatibility, the return value of :func:`~os.stat` is also accessible
as a tuple of at least 10 integers giving the most important (and portable) as a tuple of at least 10 integers giving the most important (and portable)
......
...@@ -45,7 +45,7 @@ Class Objects ...@@ -45,7 +45,7 @@ Class Objects
The :class:`Class` objects used as values in the dictionary returned by The :class:`Class` objects used as values in the dictionary returned by
:func:`readmodule` and :func:`readmodule_ex` provide the following data :func:`readmodule` and :func:`readmodule_ex` provide the following data
members: attributes:
.. attribute:: Class.module .. attribute:: Class.module
...@@ -89,7 +89,7 @@ Function Objects ...@@ -89,7 +89,7 @@ Function Objects
---------------- ----------------
The :class:`Function` objects used as values in the dictionary returned by The :class:`Function` objects used as values in the dictionary returned by
:func:`readmodule_ex` provide the following data members: :func:`readmodule_ex` provide the following attributes:
.. attribute:: Function.module .. attribute:: Function.module
......
...@@ -66,7 +66,7 @@ string instead. ...@@ -66,7 +66,7 @@ string instead.
Repr Objects Repr Objects
------------ ------------
:class:`Repr` instances provide several members which can be used to provide :class:`Repr` instances provide several attributes which can be used to provide
size limits for the representations of different object types, and methods size limits for the representations of different object types, and methods
which format specific object types. which format specific object types.
......
...@@ -24,8 +24,8 @@ The :mod:`shlex` module defines the following functions: ...@@ -24,8 +24,8 @@ The :mod:`shlex` module defines the following functions:
Split the string *s* using shell-like syntax. If *comments* is :const:`False` Split the string *s* using shell-like syntax. If *comments* is :const:`False`
(the default), the parsing of comments in the given string will be disabled (the default), the parsing of comments in the given string will be disabled
(setting the :attr:`commenters` member of the :class:`shlex` instance to the (setting the :attr:`commenters` attribute of the :class:`shlex` instance to
empty string). This function operates in POSIX mode by default, but uses the empty string). This function operates in POSIX mode by default, but uses
non-POSIX mode if the *posix* argument is false. non-POSIX mode if the *posix* argument is false.
.. note:: .. note::
...@@ -44,7 +44,7 @@ The :mod:`shlex` module defines the following class: ...@@ -44,7 +44,7 @@ The :mod:`shlex` module defines the following class:
from. It must be a file-/stream-like object with :meth:`read` and from. It must be a file-/stream-like object with :meth:`read` and
:meth:`readline` methods, or a string. If no argument is given, input will :meth:`readline` methods, or a string. If no argument is given, input will
be taken from ``sys.stdin``. The second optional argument is a filename be taken from ``sys.stdin``. The second optional argument is a filename
string, which sets the initial value of the :attr:`infile` member. If the string, which sets the initial value of the :attr:`infile` attribute. If the
*instream* argument is omitted or equal to ``sys.stdin``, this second *instream* argument is omitted or equal to ``sys.stdin``, this second
argument defaults to "stdin". The *posix* argument defines the operational argument defaults to "stdin". The *posix* argument defines the operational
mode: when *posix* is not true (default), the :class:`shlex` instance will mode: when *posix* is not true (default), the :class:`shlex` instance will
...@@ -202,8 +202,8 @@ either control lexical analysis or can be used for debugging: ...@@ -202,8 +202,8 @@ either control lexical analysis or can be used for debugging:
.. attribute:: shlex.source .. attribute:: shlex.source
This member is ``None`` by default. If you assign a string to it, that string This attribute is ``None`` by default. If you assign a string to it, that
will be recognized as a lexical-level inclusion request similar to the string will be recognized as a lexical-level inclusion request similar to the
``source`` keyword in various shells. That is, the immediately following token ``source`` keyword in various shells. That is, the immediately following token
will opened as a filename and input taken from that stream until EOF, at which will opened as a filename and input taken from that stream until EOF, at which
point the :meth:`close` method of that stream will be called and the input point the :meth:`close` method of that stream will be called and the input
...@@ -213,7 +213,7 @@ either control lexical analysis or can be used for debugging: ...@@ -213,7 +213,7 @@ either control lexical analysis or can be used for debugging:
.. attribute:: shlex.debug .. attribute:: shlex.debug
If this member is numeric and ``1`` or more, a :class:`shlex` instance will If this attribute is numeric and ``1`` or more, a :class:`shlex` instance will
print verbose progress output on its behavior. If you need to use this, you can print verbose progress output on its behavior. If you need to use this, you can
read the module source code to learn the details. read the module source code to learn the details.
......
...@@ -81,7 +81,7 @@ a threading UDP server class is created as follows:: ...@@ -81,7 +81,7 @@ a threading UDP server class is created as follows::
class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
The mix-in class must come first, since it overrides a method defined in The mix-in class must come first, since it overrides a method defined in
:class:`UDPServer`. Setting the various member variables also changes the :class:`UDPServer`. Setting the various attributes also change the
behavior of the underlying server mechanism. behavior of the underlying server mechanism.
To implement a service, you must derive a class from :class:`BaseRequestHandler` To implement a service, you must derive a class from :class:`BaseRequestHandler`
......
...@@ -2567,7 +2567,7 @@ statement is not, strictly speaking, an operation on a module object; ``import ...@@ -2567,7 +2567,7 @@ statement is not, strictly speaking, an operation on a module object; ``import
foo`` does not require a module object named *foo* to exist, rather it requires foo`` does not require a module object named *foo* to exist, rather it requires
an (external) *definition* for a module named *foo* somewhere.) an (external) *definition* for a module named *foo* somewhere.)
A special member of every module is :attr:`__dict__`. This is the dictionary A special attribute of every module is :attr:`__dict__`. This is the dictionary
containing the module's symbol table. Modifying this dictionary will actually containing the module's symbol table. Modifying this dictionary will actually
change the module's symbol table, but direct assignment to the :attr:`__dict__` change the module's symbol table, but direct assignment to the :attr:`__dict__`
attribute is not possible (you can write ``m.__dict__['a'] = 1``, which defines attribute is not possible (you can write ``m.__dict__['a'] = 1``, which defines
......
...@@ -497,38 +497,39 @@ on Windows. ...@@ -497,38 +497,39 @@ on Windows.
.. attribute:: dwFlags .. attribute:: dwFlags
A bit field that determines whether certain :class:`STARTUPINFO` members A bit field that determines whether certain :class:`STARTUPINFO`
are used when the process creates a window. :: attributes are used when the process creates a window. ::
si = subprocess.STARTUPINFO() si = subprocess.STARTUPINFO()
si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW
.. attribute:: hStdInput .. attribute:: hStdInput
If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this member is If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute
the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` is the standard input handle for the process. If
is not specified, the default for standard input is the keyboard buffer. :data:`STARTF_USESTDHANDLES` is not specified, the default for standard
input is the keyboard buffer.
.. attribute:: hStdOutput .. attribute:: hStdOutput
If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this member is If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute
the standard output handle for the process. Otherwise, this member is is the standard output handle for the process. Otherwise, this attribute
ignored and the default for standard output is the console window's is ignored and the default for standard output is the console window's
buffer. buffer.
.. attribute:: hStdError .. attribute:: hStdError
If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this member is If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute
the standard error handle for the process. Otherwise, this member is is the standard error handle for the process. Otherwise, this attribute is
ignored and the default for standard error is the console window's buffer. ignored and the default for standard error is the console window's buffer.
.. attribute:: wShowWindow .. attribute:: wShowWindow
If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this member If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute
can be any of the values that can be specified in the ``nCmdShow`` can be any of the values that can be specified in the ``nCmdShow``
parameter for the parameter for the
`ShowWindow <http://msdn.microsoft.com/en-us/library/ms633548(v=vs.85).aspx>`__ `ShowWindow <http://msdn.microsoft.com/en-us/library/ms633548(v=vs.85).aspx>`__
function, except for ``SW_SHOWDEFAULT``. Otherwise, this member is function, except for ``SW_SHOWDEFAULT``. Otherwise, this attribute is
ignored. ignored.
:data:`SW_HIDE` is provided for this attribute. It is used when :data:`SW_HIDE` is provided for this attribute. It is used when
...@@ -562,12 +563,12 @@ The :mod:`subprocess` module exposes the following constants. ...@@ -562,12 +563,12 @@ The :mod:`subprocess` module exposes the following constants.
.. data:: STARTF_USESTDHANDLES .. data:: STARTF_USESTDHANDLES
Specifies that the :attr:`STARTUPINFO.hStdInput`, Specifies that the :attr:`STARTUPINFO.hStdInput`,
:attr:`STARTUPINFO.hStdOutput`, and :attr:`STARTUPINFO.hStdError` members :attr:`STARTUPINFO.hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes
contain additional information. contain additional information.
.. data:: STARTF_USESHOWWINDOW .. data:: STARTF_USESHOWWINDOW
Specifies that the :attr:`STARTUPINFO.wShowWindow` member contains Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains
additional information. additional information.
.. data:: CREATE_NEW_CONSOLE .. data:: CREATE_NEW_CONSOLE
......
...@@ -60,7 +60,7 @@ The module defines the following user-callable items: ...@@ -60,7 +60,7 @@ The module defines the following user-callable items:
This function operates exactly as :func:`TemporaryFile` does, except that This function operates exactly as :func:`TemporaryFile` does, except that
the file is guaranteed to have a visible name in the file system (on the file is guaranteed to have a visible name in the file system (on
Unix, the directory entry is not unlinked). That name can be retrieved Unix, the directory entry is not unlinked). That name can be retrieved
from the :attr:`name` member of the file object. Whether the name can be from the :attr:`name` attribute of the file object. Whether the name can be
used to open the file a second time, while the named temporary file is used to open the file a second time, while the named temporary file is
still open, varies across platforms (it can be so used on Unix; it cannot still open, varies across platforms (it can be so used on Unix; it cannot
on Windows NT or later). If *delete* is true (the default), the file is on Windows NT or later). If *delete* is true (the default), the file is
...@@ -96,7 +96,7 @@ The module defines the following user-callable items: ...@@ -96,7 +96,7 @@ The module defines the following user-callable items:
of the temporary directory object), the newly created temporary directory of the temporary directory object), the newly created temporary directory
and all its contents are removed from the filesystem. and all its contents are removed from the filesystem.
The directory name can be retrieved from the :attr:`name` member The directory name can be retrieved from the :attr:`name` attribute
of the returned object. of the returned object.
The directory can be explicitly cleaned up by calling the The directory can be explicitly cleaned up by calling the
......
...@@ -105,7 +105,7 @@ The :mod:`urllib.request` module defines the following functions: ...@@ -105,7 +105,7 @@ The :mod:`urllib.request` module defines the following functions:
can be imported), :class:`HTTPSHandler` will also be added. can be imported), :class:`HTTPSHandler` will also be added.
A :class:`BaseHandler` subclass may also change its :attr:`handler_order` A :class:`BaseHandler` subclass may also change its :attr:`handler_order`
member variable to modify its position in the handlers list. attribute to modify its position in the handlers list.
.. function:: pathname2url(path) .. function:: pathname2url(path)
...@@ -536,7 +536,7 @@ intended for direct use: ...@@ -536,7 +536,7 @@ intended for direct use:
Remove any parents. Remove any parents.
The following members and methods should only be used by classes derived from The following attribute and methods should only be used by classes derived from
:class:`BaseHandler`. :class:`BaseHandler`.
.. note:: .. note::
......
...@@ -260,7 +260,7 @@ Exceptions in this module are coded as class instances: ...@@ -260,7 +260,7 @@ Exceptions in this module are coded as class instances:
.. exception:: Error .. exception:: Error
The base exception class. :exc:`Error` has a single public data member The base exception class. :exc:`Error` has a single public attribute
:attr:`msg` containing the description of the error. :attr:`msg` containing the description of the error.
......
...@@ -136,7 +136,7 @@ returning a value, which may be either returned data in a conformant type or a ...@@ -136,7 +136,7 @@ returning a value, which may be either returned data in a conformant type or a
:class:`Fault` or :class:`ProtocolError` object indicating an error. :class:`Fault` or :class:`ProtocolError` object indicating an error.
Servers that support the XML introspection API support some common methods Servers that support the XML introspection API support some common methods
grouped under the reserved :attr:`system` member: grouped under the reserved :attr:`system` attribute:
.. method:: ServerProxy.system.listMethods() .. method:: ServerProxy.system.listMethods()
...@@ -310,7 +310,7 @@ Fault Objects ...@@ -310,7 +310,7 @@ Fault Objects
------------- -------------
A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault
objects have the following members: objects have the following attributes:
.. attribute:: Fault.faultCode .. attribute:: Fault.faultCode
...@@ -359,7 +359,7 @@ ProtocolError Objects ...@@ -359,7 +359,7 @@ ProtocolError Objects
A :class:`ProtocolError` object describes a protocol error in the underlying A :class:`ProtocolError` object describes a protocol error in the underlying
transport layer (such as a 404 'not found' error if the server named by the URI transport layer (such as a 404 'not found' error if the server named by the URI
does not exist). It has the following members: does not exist). It has the following attributes:
.. attribute:: ProtocolError.url .. attribute:: ProtocolError.url
......
...@@ -1459,7 +1459,7 @@ complete list of changes, or look through the SVN logs for all the details. ...@@ -1459,7 +1459,7 @@ complete list of changes, or look through the SVN logs for all the details.
On FreeBSD, the :func:`os.stat` function now returns times with nanosecond On FreeBSD, the :func:`os.stat` function now returns times with nanosecond
resolution, and the returned object now has :attr:`st_gen` and resolution, and the returned object now has :attr:`st_gen` and
:attr:`st_birthtime`. The :attr:`st_flags` member is also available, if the :attr:`st_birthtime`. The :attr:`st_flags` attribute is also available, if the
platform supports it. (Contributed by Antti Louko and Diego Pettenò.) platform supports it. (Contributed by Antti Louko and Diego Pettenò.)
.. (Patch 1180695, 1212117) .. (Patch 1180695, 1212117)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment