[Python.NET] attribute semantics question

Stan Pinte stan at phidani.be
Tue Jun 14 18:19:11 CEST 2005


hello,

It is currently possible to add new attributes using the standard python 
notation, to existing C# objects.

like that:

#C is C# class

cInstance = C()
c.NewProperty = "hop" #NewProperty Property is not defined at the C# level.

My questions:

1: is this the desired/expected behaviour?
2: is this usable at C# level (I should test, I suppose, using 
introspection ;-)

--> I find it sometimes annoying not to know that I am defining a new 
attribute, because such dynamicity is not expected at C# level (well at 
python level).

thanks a lot for your help,

Stan.



More information about the PythonDotNet mailing list