[Python-3000] Fwd: defop ?
Guido van Rossum
guido at python.org
Mon Nov 27 18:41:26 CET 2006
On 11/26/06, Calvin Spealman <ironfroggy at gmail.com> wrote:
> A.b evaluates to the value of attribute 'b' of some object bound to
> name 'A', of course.
> A::b (or whatever syntax might be used) would evaluate to some value
> that actually represents "The attribute 'b' of this object". This
> "attribute object" (poor term, yes) could have other uses, but thats
> not completely relevent now. For the case at hand, basically we would
> allow the syntax for these objects to be used as legal names (keys in
> the __dict__ or elements of the __slots__). Thus, the way in
> `A.__len__` the string '__len__' is created and looked up in the
> dictionary, with `A.operator::len` (or whatever syntax is used)
> <ObjectAttribute operator module, attribute 'len'> would be the key in
> the __dict__, the actual name of the attribute of the A class.
> Basically, it allows for using any object in combination with a name
> to have identifiers that do not conflict. Thus we can have all the
> operator methods we want and never conflict with names others might
> use. The interface libraries can operate without worry. Lots of
> problems solved.
> I am sorry if my thoughts are not conveyed as clear as they sound in my mind.
No worry. It is now completely clear. The idea is interesting and it's
a useful one to have handy, even without a concrete syntax proposal.
Thanks for hanging in there!
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000