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

Skip to content

Commit 3570551

Browse files
committed
Remove most references to __members__ and __methods__, leaving only one pair
of references that now state that these attributes have been removed, directing the reader to the dir() function. This closes SF bug #456420.
1 parent 248b043 commit 3570551

4 files changed

Lines changed: 10 additions & 20 deletions

File tree

Doc/api/newtypes.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ \section{Common Object Structures \label{common-structs}}
206206
\begin{cfuncdesc}{PyObject*}{Py_FindMethod}{PyMethodDef table[],
207207
PyObject *ob, char *name}
208208
Return a bound method object for an extension type implemented in
209-
C. This function also handles the special attribute
210-
\member{__methods__}, returning a list of all the method names
211-
defined in \var{table}.
209+
C. This can be useful in the implementation of a
210+
\member{tp_getattro} or \member{tp_getattr} handler that does not
211+
use the \cfunction{PyObject_GenericGetAttr()} function.
212212
\end{cfuncdesc}
213213

214214

Doc/lib/libfuncs.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ \section{Built-in Functions \label{built-in-funcs}}
205205
Without arguments, return the list of names in the current local
206206
symbol table. With an argument, attempts to return a list of valid
207207
attribute for that object. This information is gleaned from the
208-
object's \member{__dict__}, \member{__methods__} and \member{__members__}
209-
attributes, if defined. The list is not necessarily complete. For
208+
object's \member{__dict__} attribute, if defined, and from the class
209+
or type object. The list is not necessarily complete. For
210210
example, for classes, attributes defined in base classes are not
211211
included, and for class instances, methods are not included.
212212
The resulting list is sorted alphabetically. For example:

Doc/lib/libstdtypes.tex

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,16 +1390,13 @@ \subsection{Special Attributes \label{specialattrs}}
13901390
\end{memberdesc}
13911391

13921392
\begin{memberdesc}[object]{__methods__}
1393-
List of the methods of many built-in object types. For example,
1394-
\code{[].__methods__} yields \code{['append', 'count', 'index',
1395-
'insert', 'pop', 'remove', 'reverse', 'sort']}. This usually does not
1396-
need to be explicitly provided by the object.
1393+
\deprecated{2.2}{Use the built-in function \function{dir()} to get a
1394+
list of an object's attributes. This attribute is no longer available.}
13971395
\end{memberdesc}
13981396

13991397
\begin{memberdesc}[object]{__members__}
1400-
Similar to \member{__methods__}, but lists data attributes. This
1401-
usually does not need to be explicitly provided by the object, and
1402-
need not include the names of the attributes defined in this section.
1398+
\deprecated{2.2}{Use the built-in function \function{dir()} to get a
1399+
list of an object's attributes. This attribute is no longer available.}
14031400
\end{memberdesc}
14041401

14051402
\begin{memberdesc}[instance]{__class__}

Doc/ref/ref3.tex

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,10 @@ \section{The standard type hierarchy\label{types}}
112112
Some of the type descriptions below contain a paragraph listing
113113
`special attributes.' These are attributes that provide access to the
114114
implementation and are not intended for general use. Their definition
115-
may change in the future. There are also some `generic' special
116-
attributes, not listed with the individual objects: \member{__methods__}
117-
is a list of the method names of a built-in object, if it has any;
118-
\member{__members__} is a list of the data attribute names of a built-in
119-
object, if it has any.
115+
may change in the future.
120116
\index{attribute}
121117
\indexii{special}{attribute}
122118
\indexiii{generic}{special}{attribute}
123-
\withsubitem{(built-in object attribute)}{
124-
\ttindex{__methods__}
125-
\ttindex{__members__}}
126119

127120
\begin{description}
128121

0 commit comments

Comments
 (0)