[Python-ideas] Dict-like object with property access
Stephen J. Turnbull
stephen at xemacs.org
Tue Jan 31 02:03:11 CET 2012
Massimo Di Pierro writes:
> On Jan 30, 2012, at 1:39 PM, Masklinn wrote:
> > The issue I have is that, to me, string keys say "arbitrary" and attributes say "enumerated set".
>
> I do not understand the distinciton. In fact getattr(x,...) functionally just delegates to getitem(x.__dict__, ...). I do not see why this delegation should not be achieved using the same operator __getitem__.
That's because you're looking at it through the lens of the
implementation. But you're suggesting changing the language. The
argument for that cannot depend on the implementation.
More information about the Python-ideas
mailing list