[IronPython] .NET attributes

David Fraser davidf at sjsoft.com
Fri Sep 15 16:01:46 CEST 2006


Charlie Moad wrote:
> On 9/15/06, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
>   
>> Charlie Moad wrote:
>>     
>>> On 9/14/06, Dino Viehland <dinov at exchange.microsoft.com> wrote:
>>>
>>>       
>>>> We're tentatively thinking that this is a 2.0 feature but if we figured out a syntax we really liked we'd try to get it into 1.1.
>>>>
>>>>
>>>>         
>>> It seems as if there are two clean ways to do this in my mind.
>>>
>>> 1. Use python2.4's decorator sytax and extend it to allow class and
>>> class variable attribute declaration.  This has the pitfall of
>>> breaking cpython compatibility with decorators though.  At the same
>>> time, why use decorators when you can use attributes?
>>>
>>>       
>> When this was last discussed on Python-Dev, Guido agreed that class
>> decorators could go into core Python. (Partly because of the IronPython
>> usecase.)
>>     
>
> What about class variables, properties, etc?  The "AttributeTargets"
> enum lists many options.  I don't see cpython allowing decorators on
> properties.  Also, decorators and attributes are different beasts.
> Allowing their syntax to be the same would make it difficult to
> distingush which way it should be used.  I personally think attribute
> support should trump decorator support in IP.
Take away decorator support and you'll lose at least this Python
programmer...
Decorators and attributes have at least some commonality, which is why
this syntax ended up in Python in the first place...
Allowing decorator syntax in places CPython doesn't is better than not
allowing it where it does...

David



More information about the Ironpython-users mailing list