[IronPython] NET Attributes.

Tim Riley riltim at gmail.com
Thu Jul 27 21:16:33 CEST 2006


Thanks for all the info. I was looking into using IP with AutoCAD and .NET
attributes are required.

tjr

On 7/26/06, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
>
> Martin Maly wrote:
> >
> > Unfortunately, no. Adding .NET attributes on Python classes in
> > IronPython is not possible.
> >
> > Somewhat similar Pythonic thing is function and method decorators:
> >
> > @command("MyCommand", CommandFlags.Modal)
> >
> > def RunMyCommand():
> >
> > ….
> >
> > However, this will not interoperate well with .NET since .NET is not
> > aware of the decorator mechanism.
> >
> > For more information, you can check out:
> > http://docs.python.org/whatsnew/node6.html
> >
> > There is another option to use function doc strings, but that would be
> > more complicated to use and I'd probably use it as one of the last
> > resorts.
> >
> However if you need to mark a class as serializable (or use any other
> .NET attribute), you just can't do it from IronPython at the moment. :-(
>
> Fuzzyman
> http://www.voidspace.org.uk/python/index.shtml
>
> > Martin
> >
> > ------------------------------------------------------------------------
> >
> > *From:* users-bounces at lists.ironpython.com
> > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Tim Riley
> > *Sent:* Wednesday, July 26, 2006 10:17 AM
> > *To:* Discussion of IronPython
> > *Subject:* [IronPython] NET Attributes.
> >
> > Is it possible to use .NET attributes in IronPython? For example I
> > have C# code that looks like:
> >
> > [CommandMethod("MyCommand", CommandFlags.Modal)]
> > public static void RunMyCommand()
> > {
> > 'code here
> > }
> >
> > Can I do something similiar in IP? I'll take anything.
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060727/28c26b92/attachment.html>


More information about the Ironpython-users mailing list