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
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
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
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-
"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
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
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
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