G
George Sakkis
Hi all,
I have a few questions on object introspection of builtins and
extension modules. Here's an example:
Traceback (most recent call last):
Traceback (most recent call last):
['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge__',
'__getattribute__', '__gt__', '__hash__', '__init__', '__le__',
'__lt__', '__ne__', '__new__', '__radd__', '__reduce__',
'__reduce_ex__', '__repr__', '__rsub__', '__setattr__', '__str__',
'__sub__', 'ctime', 'day', 'fromordinal', 'fromtimestamp',
'isocalendar', 'isoformat', 'isoweekday', 'max', 'min', 'month',
'replace', 'resolution', 'strftime', 'timetuple', 'today', 'toordinal',
'weekday', 'year']
- Where do the attributes of a datetime.date instance live if it has
neither a __dict__ nor __slots__ ?
- How does dir() determine them ?
- dir() returns the attributes of the instance itself, its class and
its ancestor classes. Is there a way to determine the attributes of the
instance alone ?
TIA,
George
I have a few questions on object introspection of builtins and
extension modules. Here's an example:
Traceback (most recent call last):
Traceback (most recent call last):
['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge__',
'__getattribute__', '__gt__', '__hash__', '__init__', '__le__',
'__lt__', '__ne__', '__new__', '__radd__', '__reduce__',
'__reduce_ex__', '__repr__', '__rsub__', '__setattr__', '__str__',
'__sub__', 'ctime', 'day', 'fromordinal', 'fromtimestamp',
'isocalendar', 'isoformat', 'isoweekday', 'max', 'min', 'month',
'replace', 'resolution', 'strftime', 'timetuple', 'today', 'toordinal',
'weekday', 'year']
- Where do the attributes of a datetime.date instance live if it has
neither a __dict__ nor __slots__ ?
- How does dir() determine them ?
- dir() returns the attributes of the instance itself, its class and
its ancestor classes. Is there a way to determine the attributes of the
instance alone ?
TIA,
George