We're soon (post-Beta 4) going to be making a breaking change which will alter
how protected members are exposed. Currently outside Silverlight or other
partial trust scenarios you can access protected members on any type. For
example today you can do:
import clr # required for access to .NET members on object
object().MemberwiseClone()
in beta 3 this started issuing a warning* so if you've been doing this
hopefully you've stopped :) You will still be able to do:
class x(object): pass
x().MemberwiseClone()
as you will then be accessing the type through a derived type. Likewise we'll
need to make sure that things like super continue to work as well.
The main reason I'm sending this out is just so that everyone is aware of the
upcoming change. But also I wanted to let you know of one breaking change.
That is that you will no longer be able to access protected nested classes. So
if in C# you've written:
public class Outer {
protected class Inner {
public int x = 3;
}
}
And in Python even if you subclass this:
class x(Outer): pass
you will not be able to access Inner.
The reason why we won't support this is really just a matter of prioritization
of work - we could enable richer .NET interop here if anyone was interested.
But so far this seems like a sufficiently narrow corner case and it requires a
significant amount of work so we're just trying to punt on it. Furthermore
it's not a very interesting corner case because .NET design guidelines
recommend against having non-private nested classes.
If this is problematic for anyone please let us know. Thanks!
*(that warning is overly aggressive so just because you see it doesn't mean
you're doing something wrong)
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com