A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-March/077604.html below:

[Python-Dev] No __bases__ in dir()

[Python-Dev] No __bases__ in dir()Christian Heimes lists at cheimes.de
Sat Mar 15 17:09:32 CET 2008
> Why __bases__ does not appear in dir()?
> 
> Is there a good reason for this or should I file a bug?

__bases__ and several other methods like mro and __subclasses__ are
defined on the meta class. dir() doesn't list the attributes of the meta
class of a class.


>>> class C(object):
...     pass
...
>>> dir(type(C))
['__base__', '__bases__', '__basicsize__', '__call__', '__class__',
'__cmp__', '__delattr__', '__dict__', '__dictoffset__', '__doc__',
'__flags__', '__getattribute__', '__hash__', '__init__', '__itemsize__',
'__module__', '__mro__', '__name__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__subclasses__',
'__weakrefoffset__', 'mro']

Christian

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4