Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 41125:717bc2a4eee7 legacy-trunk
Backport from Py3k branch:
Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir.
Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Mon, 12 Mar 2007 13:17:36 +0000 |
| parents | 635438b29673 |
| children | 7286d832ad27 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Mon Mar 12 11:01:10 2007 +0000 +++ b/Python/bltinmodule.c Mon Mar 12 13:17:36 2007 +0000 @@ -495,15 +495,16 @@ PyDoc_STRVAR(dir_doc, "dir([object]) -> list of strings\n" "\n" -"Return an alphabetized list of names comprising (some of) the attributes\n" -"of the given object, and of attributes reachable from it:\n" -"\n" -"No argument: the names in the current scope.\n" -"Module object: the module attributes.\n" -"Type or class object: its attributes, and recursively the attributes of\n" -" its bases.\n" -"Otherwise: its attributes, its class's attributes, and recursively the\n" -" attributes of its class's base classes."); +"If called without an argument, return the names in the current scope.\n" +"Else, return an alphabetized list of names comprising (some of) the attributes\n" +"of the given object, and of attributes reachable from it.\n" +"If the object supplies a method named __dir__, it will be used; otherwise\n" +"the default dir() logic is used and returns:\n" +" for a module object: the module's attributes.\n" +" for a class object: its attributes, and recursively the attributes\n" +" of its bases.\n" +" for an other object: its attributes, its class's attributes, and\n" +" recursively the attributes of its class's base classes."); static PyObject * builtin_divmod(PyObject *self, PyObject *args)
