Re: attribute decorators

2007-01-06 Thread Steven D'Aprano
On Fri, 05 Jan 2007 20:34:54 -0800, gert wrote: > Would it not be nice if you could assign decorators to attributes too ? > for example > > class C: > @staticattribute > data='hello' You can. You just have to write it as: class C: data = staticattribute('hello') (Of course, writing th

Re: attribute decorators

2007-01-05 Thread Gert Cuykens
sorry for repost i just found out the news group comp.lang.python is the same as python-list@python.org :) On 5 Jan 2007 20:34:54 -0800, gert <[EMAIL PROTECTED]> wrote: > Would it not be nice if you could assign decorators to attributes too ? > for example > > class C: > @staticattribute > dat

attribute decorators

2007-01-05 Thread gert
Would it not be nice if you could assign decorators to attributes too ? for example class C: @staticattribute data='hello' or class C: @privateattribute data='hello' -- http://mail.python.org/mailman/listinfo/python-list

Re: attribute decorators

2006-12-23 Thread Fredrik Lundh
Doug Holton wrote: > Don't mind Fredrik's trolling. Your examples are perfectly clear if you understand how they would work, can you explain the semantics? > however, a similar call for extending the use of decorators to other > structures besides functions was rejected: > http://lambda-the-

Re: attribute decorators

2006-12-22 Thread Terry Reedy
"Gert Cuykens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | would it not be nice if you could assign decorators to attributes too ? | for example | | class C: |@staticattribute |data='hello' | | or | | class C: |@privateattribute |data='hello' No. @g def f(): pa

Re: attribute decorators

2006-12-22 Thread DH
Fredrik Lundh wrote: > Gert Cuykens wrote: > > > would it not be nice if you could assign decorators to attributes too ? > > for example > > > > class C: > > @staticattribute > > data='hello' > > > > or > > > > class C: > > @privateattribute > > data='hello' > > and that would do w

Re: attribute decorators

2006-12-22 Thread Fredrik Lundh
Gert Cuykens wrote: > would it not be nice if you could assign decorators to attributes too ? > for example > > class C: > @staticattribute > data='hello' > > or > > class C: > @privateattribute > data='hello' and that would do what? -- http://mail.python.org/mailman/listin

attribute decorators

2006-12-22 Thread Gert Cuykens
would it not be nice if you could assign decorators to attributes too ? for example class C: @staticattribute data='hello' or class C: @privateattribute data='hello' -- http://mail.python.org/mailman/listinfo/python-list