[Python-3000] Assignment decorators

Andrew McNabb amcnabb at mcnabbs.org
Fri Dec 8 19:11:17 CET 2006

On Fri, Dec 08, 2006 at 09:48:04AM -0800, Talin wrote:
> One other minor brainstorm before I head off to work: I'd like function=
> decorators to work with assignment statements as well as 'def' statements.
> Use case:
>     class Foo:
>        @private
>        def myfunc():
>           pass
>        @private
>        selected =3D True

What would get passed to the decorator in the case of assignment?  It
would seem logical for it to be something like:

def private(name, value):

However, function decorators get something like:

def private(func):

Would these be unified, or would something completely different happen?

Andrew McNabb
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20061208/2c52b705/attachment.pgp 

More information about the Python-3000 mailing list