Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty class 'Object' #44482

Closed
kxroberto mannequin opened this issue Jan 17, 2007 · 3 comments
Closed

Empty class 'Object' #44482

kxroberto mannequin opened this issue Jan 17, 2007 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@kxroberto
Copy link
Mannequin

kxroberto mannequin commented Jan 17, 2007

BPO 1637926
Nosy @josiahcarlson, @avassalotti

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-04-27.02:29:23.784>
created_at = <Date 2007-01-17.17:51:36.000>
labels = ['interpreter-core', 'type-feature']
title = "Empty class 'Object'"
updated_at = <Date 2008-04-27.02:29:23.721>
user = 'https://bugs.python.org/kxroberto'

bugs.python.org fields:

activity = <Date 2008-04-27.02:29:23.721>
actor = 'alexandre.vassalotti'
assignee = 'none'
closed = True
closed_date = <Date 2008-04-27.02:29:23.784>
closer = 'alexandre.vassalotti'
components = ['Interpreter Core']
creation = <Date 2007-01-17.17:51:36.000>
creator = 'kxroberto'
dependencies = []
files = []
hgrepos = []
issue_num = 1637926
keywords = []
message_count = 3.0
messages = ['61266', '61267', '65868']
nosy_count = 3.0
nosy_names = ['josiahcarlson', 'kxroberto', 'alexandre.vassalotti']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue1637926'
versions = []

@kxroberto
Copy link
Mannequin Author

kxroberto mannequin commented Jan 17, 2007

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

@kxroberto kxroberto mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Jan 17, 2007
@josiahcarlson
Copy link
Mannequin

josiahcarlson mannequin commented Jan 20, 2007

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.

@avassalotti
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant