Thanks for all the info. I was looking into using IP with AutoCAD and .NET attributes are required.<br><br>tjr<br><br><div><span class="gmail_quote">On 7/26/06, <b class="gmail_sendername">Michael Foord</b> <<a href="mailto:fuzzyman@voidspace.org.uk">
fuzzyman@voidspace.org.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Martin Maly wrote:<br>><br>> Unfortunately, no. Adding .NET attributes on Python classes in
<br>> IronPython is not possible.<br>><br>> Somewhat similar Pythonic thing is function and method decorators:<br>><br>> @command("MyCommand", CommandFlags.Modal)<br>><br>> def RunMyCommand():<br>>
<br>> ….<br>><br>> However, this will not interoperate well with .NET since .NET is not<br>> aware of the decorator mechanism.<br>><br>> For more information, you can check out:<br>> <a href="http://docs.python.org/whatsnew/node6.html">
http://docs.python.org/whatsnew/node6.html</a><br>><br>> There is another option to use function doc strings, but that would be<br>> more complicated to use and I'd probably use it as one of the last<br>> resorts.
<br>><br>However if you need to mark a class as serializable (or use any other<br>.NET attribute), you just can't do it from IronPython at the moment. :-(<br><br>Fuzzyman<br><a href="http://www.voidspace.org.uk/python/index.shtml">
http://www.voidspace.org.uk/python/index.shtml</a><br><br>> Martin<br>><br>> ------------------------------------------------------------------------<br>><br>> *From:* <a href="mailto:users-bounces@lists.ironpython.com">
users-bounces@lists.ironpython.com</a><br>> [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] *On Behalf Of *Tim Riley<br>> *Sent:* Wednesday, July 26, 2006 10:17 AM
<br>> *To:* Discussion of IronPython<br>> *Subject:* [IronPython] NET Attributes.<br>><br>> Is it possible to use .NET attributes in IronPython? For example I<br>> have C# code that looks like:<br>><br>> [CommandMethod("MyCommand",
CommandFlags.Modal)]<br>> public static void RunMyCommand()<br>> {<br>> 'code here<br>> }<br>><br>> Can I do something similiar in IP? I'll take anything.<br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> users mailing list<br>> <a href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br>> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>><br><br>_______________________________________________<br>users mailing list<br><a href="mailto:users@lists.ironpython.com">users@lists.ironpython.com
</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br></blockquote></div><br>