[IronPython] .NET Attributes

Keith J. Farmer kfarmer at thuban.org
Tue Mar 28 19:55:42 CEST 2006

Then perhaps this is a point where we talk to Guido and ask him to bend
Python a little to allow a more consistent story for Python-on-.NET.
And remember that it's not just methods and classes.  Members are also
valid attribute targets.
We could come up with a different decorator altogether without breaking
Python. "//@", perhaps?  (Easily uncommented in the event that Python
decorators on non-classes are approved.)
Keith J. Farmer // kfarmer at thuban.org

-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Ernst, Nathan
Sent: Tuesday, 28 March 2006 05:42
To: Discussion of IronPython
Subject: Re: [IronPython] .NET Attributes

I wouldn't give up completely on using decorators for classes.  True,
Python 2.4 doesn't support them on classes, only functions.  I think
consistency should be sought here.

After reading PEP 318 (http://www.python.org/dev/peps/pep-0318/) a
little closer, I noticed that there *are* some examples of using
decorators on classes.  (See examples 2 and 5 at the end of the PEP).
While not included in 2.4, I could not find if it has been ruled out as
a later enhancement.

Note that there may be a potential problem using decorator syntax for
attributes.  In CPython, a decorator is merely a syntactical shortcut
for applying a function to a function definition.  It could be said
that, in IronPython, the attribute is being applied to a function.  To
me, this seems kind of confused, as the attribute descriptor now becomes
a special case descriptor for the interpreter to have to handle because
the descriptor is not being called with the function/class definition as
an argument.  Instead, the attributes must be compiled into the
generated code. 

It is probably not that large of a deal, though. (Just playing devil's
advocate here). Despite this, I still like the decorator syntax.


-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Monday, March 27, 2006 11:45 PM
To: Discussion of IronPython
Subject: Re: [IronPython] .NET Attributes

I like this too...  It's interesting that while the syntax isn't exactly
the same for giving both classes & functions attributes they are both
getting that information in the same way.  I was previously worried
about the differences between classes & functions but I think this
brings it all together.



This e-mail contains information that may be confidential and 
proprietary. It is to be read and used solely by the intended
Citadel and its affiliates retain all proprietary rights they may have
in the 
information. If you are not an intended recipient, please notify us 
immediately either by reply e-mail or by telephone at 312-395-2100 
and delete this e-mail (including any attachments hereto) immediately 
without reading, disseminating, distributing or copying. We cannot give 
any assurances that this e-mail and any attachments are free of viruses 
and other harmful code. Citadel reserves the right to monitor, intercept

and block all communications involving its computer systems.

users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list