What is the rationale behind making the _dict_ attribute dictionary immutable for .net objects? For instance, the following code sample will demonstrate what I mean; you can set any attributes you want in classes created in IronPython,
but classes coming from .NET have different rules. In the aim of both ease of use and consistency, I think this should be addressed in the next release of IronPython. You may have already considered this, and if there's a technical reason for the status quo,
I would like you to enlighten me =]. Thanks.
from System.Windows.Forms import *
- part 1: This makes #2 possible.
class Button(Button): pass
button = Button()
button.Text = "Click Me!"
- part 2: Without part 1, this is an error because Button()'s _dict_ is immutable.
button.clickText = "You clicked me!"
button.Click += lambda sender, e: MessageBox.Show(button.clickText)
if _name_ == '_main_':