This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Empty class 'Object'
Type: enhancement Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: alexandre.vassalotti, josiahcarlson, kxroberto
Priority: normal Keywords:

Created on 2007-01-17 17:51 by kxroberto, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg61266 - (view) Author: kxroberto (kxroberto) Date: 2007-01-17 17:51
An empty class 'Object' in builtins, which can be instantiated (with optional inline arguments as attributes (like dict)), and attributes added. Convenience - Easy OO variable container - known to pickle etc.

http://groups.google.com/group/comp.lang.python/msg/3ff946e7da13dba9

http://groups.google.de/group/comp.lang.python/msg/a02f0eb4efb76b24

idea:

class X(object):
    def __init__(self,_d={},**kwargs):
        kwargs.update(_d)
        self.__dict__=kwargs
class Y(X):
    def __repr__(self):
        return '<Y:%s>'%self.__dict__

------

x=X(spam=1) 
x.a=3




Robert
msg61267 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2007-01-20 18:35
This has been requested in various forms over the years.  See the "bunch" discussion on the python-dev mailing list from over a year ago.  There may have even been a PEP.  I believe the general consensus was "it would be convenient sometimes, but it is *trivial* to implement it as necessary".  Also, not every X-line function or class should be included with Python.
msg65868 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2008-04-27 02:29
This has almost no-chance to get included in the standard library. Also,
Python 2.6 will include ``namedtuple`` (see
http://docs.python.org/dev/library/collections.html#collections.namedtuple),
which provides similar functionally.

Closing this issue as rejected.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44482
2008-04-27 02:29:23alexandre.vassalottisetstatus: open -> closed
nosy: + alexandre.vassalotti
resolution: rejected
messages: + msg65868
2007-01-17 17:51:36kxrobertocreate