cpython: d442c313536b (original) (raw)

Mercurial > cpython

changeset 71208:d442c313536b 3.2

issue10403 - Let's not use members anymore. Use 'attribute' where it denotes attribute and 'methods' where it denotes methods. Context should clarify usage. [#10403]

Senthil Kumaran senthil@uthcode.com
date Mon, 04 Jul 2011 11:28:30 -0700
parents ab22ffd905b3
children 283f20f1d31f 184192b3687c
files Doc/library/cmd.rst Doc/library/curses.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/doctest.rst Doc/library/gzip.rst Doc/library/html.entities.rst Doc/library/http.cookies.rst Doc/library/io.rst Doc/library/nntplib.rst Doc/library/os.rst Doc/library/pyclbr.rst Doc/library/reprlib.rst Doc/library/shlex.rst Doc/library/socketserver.rst Doc/library/stdtypes.rst Doc/library/subprocess.rst Doc/library/tempfile.rst Doc/library/urllib.request.rst Doc/library/xdrlib.rst Doc/library/xmlrpc.client.rst Doc/whatsnew/2.5.rst
diffstat 22 files changed, 127 insertions(+), 125 deletions(-)[+] [-] Doc/library/cmd.rst 2 Doc/library/curses.rst 4 Doc/library/datetime.rst 133 Doc/library/decimal.rst 2 Doc/library/doctest.rst 19 Doc/library/gzip.rst 2 Doc/library/html.entities.rst 2 Doc/library/http.cookies.rst 2 Doc/library/io.rst 4 Doc/library/nntplib.rst 2 Doc/library/os.rst 11 Doc/library/pyclbr.rst 4 Doc/library/reprlib.rst 2 Doc/library/shlex.rst 12 Doc/library/socketserver.rst 2 Doc/library/stdtypes.rst 2 Doc/library/subprocess.rst 29 Doc/library/tempfile.rst 4 Doc/library/urllib.request.rst 4 Doc/library/xdrlib.rst 2 Doc/library/xmlrpc.client.rst 6 Doc/whatsnew/2.5.rst 2

line wrap: on

line diff

--- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -50,7 +50,7 @@ A :class:Cmd instance has the followin the line as argument. The optional argument is a banner or intro string to be issued before the first

--- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1639,7 +1639,7 @@ You can instantiate a :class:Textbox o each keystroke entered with the keystroke as a parameter; command dispatch 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

.. method:: do_command(ch) @@ -1711,7 +1711,7 @@ You can instantiate a :class:Textbox o .. attribute:: stripspaces

--- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -11,7 +11,7 @@ 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 -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 functionality, see also the :mod:time and :mod:calendar modules. @@ -25,7 +25,7 @@ miles, or mass. Naive :class:datetime work with, at the cost of ignoring some aspects of reality. 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 :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 @@ -499,9 +499,9 @@ Instance methods: .. method:: date.replace(year, month, day)

.. method:: date.timetuple() @@ -732,11 +732,11 @@ Other constructors, all class methods: .. classmethod:: datetime.combine(date, time)

.. classmethod:: datetime.strptime(date_string, format) @@ -830,43 +830,44 @@ Supported operations: (1) datetime2 is a duration of timedelta removed from datetime1, moving forward in time if timedelta.days > 0, or backward if timedelta.days < 0. The

(2) Computes the datetime2 such that datetime2 + timedelta == datetime1. As for

(3) 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 naive, :exc:TypeError is raised.

(4) datetime1 is considered less than datetime2 when datetime1 precedes datetime2 in time. If one comparand is naive and the other is aware, :exc:TypeError is raised.

@@ -899,22 +900,22 @@ Instance methods: .. method:: datetime.timetz() Return :class:time object with same hour, minute, second, microsecond, and

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

.. method:: datetime.astimezone(tz)

.. method:: time.isoformat() @@ -1354,7 +1355,7 @@ EDT. 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 -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 zone, and DST offset, all relative to a date or time object passed to them. @@ -1399,9 +1400,9 @@ methods. Exactly which methods are need 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 separately. For example, :meth:datetime.timetuple calls its :attr:tzinfo

--- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -654,7 +654,7 @@ Decimal objects Normalize the number by stripping the rightmost trailing zeros and converting any result equal to :const:Decimal('0') to

--- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -1127,11 +1127,10 @@ DocTest Objects .. class:: DocTest(examples, globs, name, filename, lineno, docstring) A collection of doctest examples that should be run in a single namespace. The

@@ -1184,11 +1183,11 @@ Example Objects .. 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

@@ -1675,9 +1674,9 @@ There are two exceptions that may be rai 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

-:exc:DocTestFailure defines the following member variables: +:exc:DocTestFailure defines the following attributes: .. attribute:: DocTestFailure.test @@ -1699,9 +1698,9 @@ There are two exceptions that may be rai An exception raised by :class:DocTestRunner to signal that a doctest example raised an unexpected exception. The constructor arguments are used

-:exc:UnexpectedException defines the following member variables: +:exc:UnexpectedException defines the following attributes: .. attribute:: UnexpectedException.test

--- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -61,7 +61,7 @@ The module defines the following items: time is used. This module ignores the timestamp when decompressing; 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

--- a/Doc/library/html.entities.rst +++ b/Doc/library/html.entities.rst @@ -11,7 +11,7 @@ This module defines three dictionaries, name2codepoint, codepoint2name, 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 simple textual substitution in the Latin-1 character set (ISO-8859-1).

--- a/Doc/library/http.cookies.rst +++ b/Doc/library/http.cookies.rst @@ -152,7 +152,7 @@ Morsel Objects .. method:: Morsel.set(key, value, coded_value)

.. method:: Morsel.isReservedKey(K)

--- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -391,8 +391,8 @@ I/O Base Classes :class:RawIOBase implementation, but wrap one, like :class:BufferedWriter and :class:BufferedReader do.

--- a/Doc/library/nntplib.rst +++ b/Doc/library/nntplib.rst @@ -394,7 +394,7 @@ tuples or objects that the method normal Send an ARTICLE command, where message_spec has the same meaning as for :meth:stat. Return a tuple (response, info) where info

--- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1339,11 +1339,12 @@ Files and Directories .. note::

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)

--- a/Doc/library/pyclbr.rst +++ b/Doc/library/pyclbr.rst @@ -45,7 +45,7 @@ Class Objects The :class:Class objects used as values in the dictionary returned by :func:readmodule and :func:readmodule_ex provide the following data -members: +attributes: .. attribute:: Class.module @@ -89,7 +89,7 @@ Function Objects ---------------- 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

--- a/Doc/library/reprlib.rst +++ b/Doc/library/reprlib.rst @@ -66,7 +66,7 @@ string instead. 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 which format specific object types.

--- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -24,8 +24,8 @@ The :mod:shlex module defines the foll 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

.. attribute:: shlex.source

.. attribute:: shlex.debug

--- a/Doc/library/socketserver.rst +++ b/Doc/library/socketserver.rst @@ -81,7 +81,7 @@ a threading UDP server class is created class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass 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. To implement a service, you must derive a class from :class:BaseRequestHandler

--- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2567,7 +2567,7 @@ statement is not, strictly speaking, an foodoes not require a module object named *foo* to exist, rather it requires[](#l16.4) an (external) *definition* for a module named *foo* somewhere.)[](#l16.5) [](#l16.6) -A special member of every module is :attr:`__dict__`. This is the dictionary[](#l16.7) +A special attribute of every module is :attr:`__dict__`. This is the dictionary[](#l16.8) containing the module's symbol table. Modifying this dictionary will actually[](#l16.9) change the module's symbol table, but direct assignment to the :attr:`__dict__`[](#l16.10) attribute is not possible (you can writem.dict['a'] = 1``, which defines

--- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -497,38 +497,39 @@ on Windows. .. attribute:: dwFlags

si = subprocess.STARTUPINFO() si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW .. attribute:: hStdInput

.. attribute:: hStdOutput

.. attribute:: hStdError

.. attribute:: wShowWindow

:data:SW_HIDE is provided for this attribute. It is used when @@ -562,12 +563,12 @@ The :mod:subprocess module exposes the .. data:: STARTF_USESTDHANDLES Specifies that the :attr:STARTUPINFO.hStdInput,

.. data:: STARTF_USESHOWWINDOW

.. data:: CREATE_NEW_CONSOLE

--- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -60,7 +60,7 @@ The module defines the following user-ca This function operates exactly as :func:TemporaryFile does, except that 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

--- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -105,7 +105,7 @@ The :mod:urllib.request module defines can be imported), :class:HTTPSHandler will also be added. A :class:BaseHandler subclass may also change its :attr:handler_order

.. function:: pathname2url(path) @@ -536,7 +536,7 @@ intended for direct use: 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. .. note::

--- a/Doc/library/xdrlib.rst +++ b/Doc/library/xdrlib.rst @@ -260,7 +260,7 @@ Exceptions in this module are coded as c .. exception:: Error

--- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -136,7 +136,7 @@ returning a value, which may be either r :class:Fault or :class:ProtocolError object indicating an error. 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() @@ -310,7 +310,7 @@ Fault Objects ------------- 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 @@ -359,7 +359,7 @@ ProtocolError Objects 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 -does not exist). It has the following members: +does not exist). It has the following attributes: .. attribute:: ProtocolError.url

--- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1459,7 +1459,7 @@ complete list of changes, or look throug On FreeBSD, the :func:os.stat function now returns times with nanosecond resolution, and the returned object now has :attr:st_gen and