Message173225
| Author |
chris.jerdonek |
| Recipients |
Arfrever, chris.jerdonek, christopherthemagnificent, kushal.das |
| Date |
2012年10月18日.02:06:39 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1350525999.62.0.331075569126.issue16268@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here is a somewhat simpler way to reproduce (following the same definition of x):
>>> dir(x)
...
TypeError: object does not provide __dir__
>>> x.__dir__
<built-in method __dir__ of cell object at 0x10c182950>
>>> dir(x)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'cell_contents']
The dir() documentation says, "If the object has a method named __dir__(), this method will be called and must return the list of attributes."
(from http://docs.python.org/py3k/library/functions.html#dir ) |
|