Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107704

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Differences between Class(Object) and Class(Dict) for dictionary usage?
Date 2016-04-27 13:54 +1000
Message-ID <mailman.139.1461729264.32212.python-list@python.org> (permalink)
References <5720357B.4060009@icloud.com> <85bn4vlna4.fsf@benfinney.id.au>

Show all headers | View raw


Christopher Reimer <christopher_reimer@icloud.com> writes:

> If I'm using a dictionary to store variables for an object, and
> accessing the variable values from dictionary via property decorators

Why not use the built-in ‘dict’ type?

What does the new type do which isn't already better served by the
built-in ‘dict’ type?

(Note that “allow attribute-syntax access to dictionary items” does not
qualify as “better”, IMO; it qualifies as “needlessly confusing distinct
concepts”.)

> I haven't seen a good pro/con discussion on the Internet for using one
> over the other.

I haven't seen a good pro/con discussion of the use case you're trying
to address :-)

-- 
 \        “I'd take the awe of understanding over the awe of ignorance |
  `\                                          any day.” —Douglas Adams |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Differences between Class(Object) and Class(Dict) for dictionary usage? Ben Finney <ben+python@benfinney.id.au> - 2016-04-27 13:54 +1000

csiph-web