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> &lt;<a href="mailto:fuzzyman@voidspace.org.uk">
fuzzyman@voidspace.org.uk</a>&gt; 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>&gt;<br>&gt; Unfortunately, no. Adding .NET attributes on Python classes in
<br>&gt; IronPython is not possible.<br>&gt;<br>&gt; Somewhat similar Pythonic thing is function and method decorators:<br>&gt;<br>&gt; @command("MyCommand", CommandFlags.Modal)<br>&gt;<br>&gt; def RunMyCommand():<br>&gt;
<br>&gt; ….<br>&gt;<br>&gt; However, this will not interoperate well with .NET since .NET is not<br>&gt; aware of the decorator mechanism.<br>&gt;<br>&gt; For more information, you can check out:<br>&gt; <a href="http://docs.python.org/whatsnew/node6.html">
http://docs.python.org/whatsnew/node6.html</a><br>&gt;<br>&gt; There is another option to use function doc strings, but that would be<br>&gt; more complicated to use and I'd probably use it as one of the last<br>&gt; resorts.
<br>&gt;<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>&gt; Martin<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; *From:* <a href="mailto:users-bounces@lists.ironpython.com">
users-bounces@lists.ironpython.com</a><br>&gt; [mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>] *On Behalf Of *Tim Riley<br>&gt; *Sent:* Wednesday, July 26, 2006 10:17 AM
<br>&gt; *To:* Discussion of IronPython<br>&gt; *Subject:* [IronPython] NET Attributes.<br>&gt;<br>&gt; Is it possible to use .NET attributes in IronPython? For example I<br>&gt; have C# code that looks like:<br>&gt;<br>&gt; [CommandMethod(&quot;MyCommand&quot;, 
CommandFlags.Modal)]<br>&gt; public static void RunMyCommand()<br>&gt; {<br>&gt; 'code here<br>&gt; }<br>&gt;<br>&gt; Can I do something similiar in IP? I'll take anything.<br>&gt;<br>&gt; ------------------------------------------------------------------------
<br>&gt;<br>&gt; _______________________________________________<br>&gt; users mailing list<br>&gt; <a href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br>&gt; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>&gt;<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>