[IronPython] Decorators on classes

Michael Foord fuzzyman at voidspace.org.uk
Tue Feb 5 01:07:57 CET 2008


Curt Hagenlocher wrote:
> On Feb 4, 2008 3:29 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
>   
>> It is rather ugly. :-)
>>     
>
> Thanks; I thought so myself.
>
>   
>> Would this technique have anything to offer for attributes on methods
>> and properties (etc).
>>     
>
> It's hard to see how, but it's been a while since I looked at that
> part of the source.  I'm pretty sure that the CLR class itself needs
> to be emitted entirely by the contents of the one "class" statement --
> and well before the first method is defined.  Which means that none of
> the properties or methods of the class could influence codegen.
>
> Frankly, I don't think that attributes on methods or properties are
> realistic -- at least, not as part of the original class definition.
> What I think you'd be looking at is the ability to define a class
> wrapper that wraps the initially-defined dynamic class with a new
> statically-defined class that allows you to put attributes on methods
> and properties.  Hmm... where have I heard that recently... :)
>   

Getting attributes on classes would be a start - but for example with 
Silverlight you would want to be able to mark methods as 'Scriptable'. 
It sounds like Dino has some ideas on this though.

When I was thinking about auto generating static assemblies from Python 
source it did occur to me that it would be possible to use simple 
markers to enable attributes...

Michael

> --
> Curt Hagenlocher
> curt at hagenlocher.org
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>   




More information about the Ironpython-users mailing list