Re: Can we create an_object = object() and add attribute like fora class?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

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

From: Alex Martelli <aleaxit@yahoo.com>
Date: Sun Apr 30 2006 - 02:49:21 CEST

Pierre Rouleau <prouleau@impathnetworks.com> wrote:

> Fredrik Lundh wrote:
>
> > Pierre Rouleau 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.
> >
> > so you can replace one line of code in some of your programs with
> > an import statement ?
>
> ok... I should have said "something like the built-in object type"
> instead of "standard library"...

I'm -1 on adding a new built-in for this functionality -- it's just not
important enough to warrant a built-in (there are already too many
built-ins!).

Putting a "namespace type" in the standard library could provide enough
helpful functionality to make an import well warranted, so I'm +1 on
adding such a type to the standard library (in 2.6 -- I think it's too
late for 2.6).

Alex
Received on Mon May 1 00:46:14 2006