[IronPython] __delattr__ in .NET class

Dino Viehland dinov at microsoft.com
Fri Dec 3 07:35:29 CET 2010

Slide wrote:
> I am currently implementing a module in C#. I need to be able to override the
> __delattr__ method for one of my objects. I've put in a __delattr__ method
> that takes a string, but it never gets called. I also tried DeleteMember
> because I saw that around too. Is there a way to do this?

Did DeleteMember have [SpecialName] attribute on it?  It should work if it's got
that attribute.  The ideal way to do this is to implement IDynamicMetaObjectProvider
so that it'll work from all languages (DeleteMember is more of a IronPython-ism).

More information about the Ironpython-users mailing list