We don&#39;t support this in IronPython 2.0, no. &nbsp;And oddly, no one seems to have added this as a &quot;desired feature&quot; in CodePlex, even though it&#39;s come up a few times before on this list.<div><br></div><div>The most likely way that we&#39;d initially provide support for this is to let you override the &quot;CLS backing class&quot; that&#39;s being used to represent your Python class -- this would mean that you&#39;d need to do the code generation for the attribute yourself, though.<br>
<br><div class="gmail_quote">On Thu, Dec 11, 2008 at 7:58 AM, Jeff Slutter <span dir="ltr">&lt;<a href="mailto:jslutter@reactorzero.com">jslutter@reactorzero.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Excuse me if this is known or not, but searching around has only turned<br>
up articles/mailing lists posts that are two years old, but does<br>
IronPython 2.0 support .NET attributes yet?<br>
<br>
I&#39;ve seen some examples of doing it using stub classes in C# and then<br>
deriving from the in Python, but I&#39;m not sure if this will work for me.<br>
I need to put an Attribute on a class, or method, in Python that takes a<br>
string argument. I can&#39;t think of a workaround to get this support.<br>
<br>
For example, in C# the class would be:<br>
<br>
class Foo<br>
{<br>
 &nbsp; &nbsp; [MyNameAttribute(&quot;Test name&quot;)]<br>
 &nbsp; &nbsp; public void Method()<br>
 &nbsp; &nbsp; {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.Write(&quot;test&quot;);<br>
 &nbsp; &nbsp; }<br>
}<br>
<br>
And the string &quot;Test name&quot; could be different for each use of<br>
MyNameAttribute. I use it for internal registration purposes in my C# code.<br>
<br>
How would I write this class in IP?<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" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br></div>