\begin{cfuncdesc}{PyObject*}{Py_FindMethod}{PyMethodDef table[],
PyObject *ob, char *name}
Return a bound method object for an extension type implemented in
- C. This function also handles the special attribute
- \member{__methods__}, returning a list of all the method names
- defined in \var{table}.
+ C. This can be useful in the implementation of a
+ \member{tp_getattro} or \member{tp_getattr} handler that does not
+ use the \cfunction{PyObject_GenericGetAttr()} function.
\end{cfuncdesc}
Without arguments, return the list of names in the current local
symbol table. With an argument, attempts to return a list of valid
attribute for that object. This information is gleaned from the
- object's \member{__dict__}, \member{__methods__} and \member{__members__}
- attributes, if defined. The list is not necessarily complete. For
+ object's \member{__dict__} attribute, if defined, and from the class
+ or type object. The list is not necessarily complete. For
example, for classes, attributes defined in base classes are not
included, and for class instances, methods are not included.
The resulting list is sorted alphabetically. For example:
\end{memberdesc}
\begin{memberdesc}[object]{__methods__}
-List of the methods of many built-in object types. For example,
-\code{[].__methods__} yields \code{['append', 'count', 'index',
-'insert', 'pop', 'remove', 'reverse', 'sort']}. This usually does not
-need to be explicitly provided by the object.
+\deprecated{2.2}{Use the built-in function \function{dir()} to get a
+list of an object's attributes. This attribute is no longer available.}
\end{memberdesc}
\begin{memberdesc}[object]{__members__}
-Similar to \member{__methods__}, but lists data attributes. This
-usually does not need to be explicitly provided by the object, and
-need not include the names of the attributes defined in this section.
+\deprecated{2.2}{Use the built-in function \function{dir()} to get a
+list of an object's attributes. This attribute is no longer available.}
\end{memberdesc}
\begin{memberdesc}[instance]{__class__}
Some of the type descriptions below contain a paragraph listing
`special attributes.' These are attributes that provide access to the
implementation and are not intended for general use. Their definition
-may change in the future. There are also some `generic' special
-attributes, not listed with the individual objects: \member{__methods__}
-is a list of the method names of a built-in object, if it has any;
-\member{__members__} is a list of the data attribute names of a built-in
-object, if it has any.
+may change in the future.
\index{attribute}
\indexii{special}{attribute}
\indexiii{generic}{special}{attribute}
-\withsubitem{(built-in object attribute)}{
- \ttindex{__methods__}
- \ttindex{__members__}}
\begin{description}