[IronPython] Get a string from JavaScript to IronPython

Michael Foord fuzzyman at voidspace.org.uk
Wed Jan 7 00:07:01 CET 2009


Dino Viehland wrote:
> Strangely I don't see one - this is frequently asked for so I'm a little surprised :)
>
> I have a plan on how to enable this (and some other .NET scenarios) in the next major release.  My current thinking is to support this via meta-classes and providing a new method on type which lets you specify the underlying .NET type used for the Python type.  That will enable this feature to be implemented in Python along with other .NET interop features like:
>         having a Python type which has a default constructor which is available to .NET (important for frameworks which use reflection to create instances).
>         Having concrete .NET members which expose Python members (important for frameworks which use reflection for member access - e.g. data binding).
>
> People can then debate and throw around code for what the best syntax for .NET custom attributes is from Python and implement it themselves.  If anyone has feedback on this I'd love to hear it.
>   
If the class is created by type then ordinary decorator syntax could be 
used - attaching metadata to the methods which type could use. If a pure 
Python class uses attributes then I guess a real .NET type would need to 
be created, which may restrict some of the things that can be done to 
the class. Definitely a price worth paying if it allows us to use 
attributes.

Being able to use Python classes with frameworks that use reflection 
would also be great!

Michael


> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cenovsky, Lukas
> Sent: Tuesday, January 06, 2009 9:13 AM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Get a string from JavaScript to IronPython
>
>   
>> Unfortunately we can't apply attributes to Python classes. I
>> get round
>> this particular problem by creating stub classes in C# and inheriting
>> from them in Python. See:
>>
>> http://www.voidspace.org.uk/ironpython/silverlight/scriptable.shtml
>>     
>
> Is there a CodePlex issue to resolve this?
>
> --
> -- Lukas
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list