Can we create an_object = object() and add attribute like for a class?

2006-04-29 Thread Pierre Rouleau
Hi all, Is there any reason that under Python you cannot instantiate the object class and create any attributes like you would be able for a normal class? Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: Can we create an_object = object() and add attribute like for a class?

2006-04-29 Thread Alex Martelli
Pierre Rouleau [EMAIL PROTECTED] wrote: Hi all, Is there any reason that under Python you cannot instantiate the object class and create any attributes like you would be able for a normal class? Yep: instances of type object do not have a __dict__ and therefore there is no place to put any

Re: Can we create an_object = object() and add attribute like for a class?

2006-04-29 Thread Pierre Rouleau
Alex Martelli wrote: Pierre Rouleau [EMAIL PROTECTED] wrote: Hi all, Is there any reason that under Python you cannot instantiate the object class and create any attributes like you would be able for a normal class? Yep: instances of type object do not have a __dict__ and therefore

Re: Can we create an_object = object() and add attribute like for a class?

2006-04-29 Thread Alex Martelli
Pierre Rouleau [EMAIL PROTECTED] wrote: ... I can understand the design decision not to give object a __dict__, but I wonder if i'd be a good idea to have a class that derives from object and has a __dict__ to be in the standard library. I posted the original question because I run into