[IronPython] overriding methods from C# classes

Dino Viehland dinov at microsoft.com
Fri Jul 9 21:11:54 CEST 2010


Marcin wrote:
> Curt Hagenlocher wrote:
> > Yes. It's universally true in the CLR that you can't override a function
> > in a derived class unless the function was marked as virtual in the base
> > class. IronPython is no different than C# in this regard.
> 
> One thing that would be *nice* for C# noobs like me would be throwing an
> exception in IPY when a method in a base C# class assembly isn't virtual.
> 
Unfortunately some time you want to do this - C# has "new" as well which 
explicitly lets you do this (otherwise it's only a warning).  If anything I
could see us providing a warning here but we'd need some way to squelch it 
as well.  And it would have an additional cost for constructing classes that
I'm not certain would be worth it.





More information about the Ironpython-users mailing list