[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=
=20
> decorators to work with assignment statements as well as 'def' statements.
>=20
> Use case:
>=20
> class Foo:
>=20
> @private
> def myfunc():
> pass
>=20
> @private
> selected =3D True
>=20
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):
pass
However, function decorators get something like:
def private(func):
pass
Would these be unified, or would something completely different happen?
--
Andrew McNabb
http://www.mcnabbs.org/andrew/
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