Re: Attributes of builtin/extension objects

2005-11-02 Thread Steven Bethard
George Sakkis wrote: > - Where do the attributes of a datetime.date instance live if it has > neither a __dict__ nor __slots__ ? > - How does dir() determine them ? py> from datetime import date py> d = date(2003,1,23) py> dir(date) == dir(d) True py> for attr_name in ['day', 'month', 'year']: ...

Attributes of builtin/extension objects

2005-11-02 Thread George Sakkis
Hi all, I have a few questions on object introspection of builtins and extension modules. Here's an example: >>> from datetime import date >>> d=date(2003,1,23) >>> d.__dict__ Traceback (most recent call last): File "", line 1, in ? AttributeError: 'datetime.date' object has no attribute '__dic