|
|
发表于 2014-7-6 22:05:01
|
显示全部楼层
貌似不同吧~{:7_181:}
- >>> help(dir)
- Help on built-in function dir in module builtins:
- dir(...)
- dir([object]) -> list of strings
-
- If called without an argument, return the names in the current scope.
- Else, return an alphabetized list of names comprising (some of) the attributes
- of the given object, and of attributes reachable from it.
- If the object supplies a method named __dir__, it will be used; otherwise
- the default dir() logic is used and returns:
- for a module object: the module's attributes.
- for a class object: its attributes, and recursively the attributes
- of its bases.
- for any other object: its attributes, its class's attributes, and
- recursively the attributes of its class's base classes.
- >>> dir(dir)
- ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']
- >>> help(help)
- Help on _Helper in module _sitebuiltins object:
- class _Helper(builtins.object)
- | Define the builtin 'help'.
- | This is a wrapper around pydoc.help (with a twist).
- |
- | Methods defined here:
- |
- | __call__(self, *args, **kwds)
- |
- | __repr__(self)
- |
- | ----------------------------------------------------------------------
- | Data descriptors defined here:
- |
- | __dict__
- | dictionary for instance variables (if defined)
- |
- | __weakref__
- | list of weak references to the object (if defined)
- >>> dir(help)
- ['__call__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
- >>>
复制代码 |
|