[IronPython] Announcing IronPython 2.0

Curt Hagenlocher curt at hagenlocher.org
Thu Dec 11 17:46:49 CET 2008


We don't support this in IronPython 2.0, no.  And oddly, no one seems to
have added this as a "desired feature" in CodePlex, even though it's come up
a few times before on this list.
The most likely way that we'd initially provide support for this is to let
you override the "CLS backing class" that's being used to represent your
Python class -- this would mean that you'd need to do the code generation
for the attribute yourself, though.

On Thu, Dec 11, 2008 at 7:58 AM, Jeff Slutter <jslutter at reactorzero.com>wrote:

> Excuse me if this is known or not, but searching around has only turned
> up articles/mailing lists posts that are two years old, but does
> IronPython 2.0 support .NET attributes yet?
>
> I've seen some examples of doing it using stub classes in C# and then
> deriving from the in Python, but I'm not sure if this will work for me.
> I need to put an Attribute on a class, or method, in Python that takes a
> string argument. I can't think of a workaround to get this support.
>
> For example, in C# the class would be:
>
> class Foo
> {
>     [MyNameAttribute("Test name")]
>     public void Method()
>     {
>           Console.Write("test");
>     }
> }
>
> And the string "Test name" could be different for each use of
> MyNameAttribute. I use it for internal registration purposes in my C# code.
>
> How would I write this class in IP?
>
>
>
> _______________________________________________
> 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/20081211/199eb56c/attachment.html>


More information about the Ironpython-users mailing list