[Python-ideas] Add kwargs to built-in function object

Aahz aahz at pythoncraft.com
Thu May 22 14:22:04 CEST 2008


On Thu, May 22, 2008, Brandon Mintern wrote:
>
> I would like to propose to change the built-in function "object" to
> have the following syntax:
> 
> object(**kwargs)
> Return a new featureless object. object is a base for all new style
> classes. It has the methods that are common to all instances of new
> style classes.

Enh.  It's easy enough to write

    class Obj:
        def __init__(self, **kwargs):
            self.__dict__.update(kwargs)

It's not clear to me that your functionality is desired frequently enough
*in that specific form* to warrant changing object().  Note particularly
the emphasis; over the years, I've seen various small variations in how
people want kwargs processed and it's not at all clear to me that
codifying one specific form into the language would be helpful.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Need a book?  Use your library!



More information about the Python-ideas mailing list