Issue 1637926: Empty class 'Object' (original) (raw)

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:22 admin set github: 44482
2008-04-27 02:29:23 alexandre.vassalotti set status: open -> closednosy: + alexandre.vassalottiresolution: rejectedmessages: +
2007-01-17 17:51:36 kxroberto create