[Python-ideas] Dict-like object with property access

Cameron Simpson cs at zip.com.au
Mon Jan 30 22:22:10 CET 2012

On 30Jan2012 10:28, Eric Snow <ericsnowcurrently at gmail.com> wrote:
| On Mon, Jan 30, 2012 at 10:14 AM, Arnaud Delobelle <arnodel at gmail.com> wrote:
| > On Jan 30, 2012 4:23 PM, "Massimo Di Pierro" <massimo.dipierro at gmail.com>
| > wrote:
| >> I do not think the issue is whether the people who use that semantic
| >> understand it or not. I can assure you they do and they know when it is
| >> appropriate to use it or not. The issue is whether there is any value is
| >> making it faster by including it in python or not. Because of the increasing
| >> popularity of JS I think new users are starting to expect something like it
| >> out of the box.
| >
| > But this design decision in JavaScript is at the heart of many problems
| > (e.g. simply looping over keys is a pain).  That it is widely used doesn't
| > make it desirable. My experience with JavaScript is that we should keep this
| > 'feature' out of Python. If people want it they can implement it very easily
| > but encouraging them would be wrong.
| +1


Like a few others, I have implemented this kind of class. The only one
of mine that survives only supports .UPPERCASE attribute->key access and
is quite special purpose. I'm very much against including such a
facility in the language directly.
Cameron Simpson <cs at zip.com.au> DoD#743

Excuse me, do you know what time it is?
-About Noon.
I'd prefer something more exact . . .
-About Noon, Stupid.

More information about the Python-ideas mailing list