[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 4 01:29:46 CET 2011


Ethan Furman wrote:
> Do we even need the def?
> 
> class Person(object):
>     name    as Str()
>     address as Str()

I think that would be paring it down a bit foo far -- there's
not much left to suggest that a name is being bound. At
least 'def' implies that something is being defined rather
than just referred to.

> we could also add more magic and make the assigned name an available 
> attribute to the function when it's called.

I don't understand. Attribute of what?

-- 
Greg



More information about the Python-ideas mailing list