[Ironpython-users] IronPython on Windows Phone

Dino Viehland dinov at microsoft.com
Tue Mar 6 19:00:53 CET 2012


Jeff wrote:
> Looking at it briefly I can't see an obvious workaround (I'm not sure what
> interactions MaybeNotImplementedAttribute will have); can you open an issue
> and attach a minimal repro if possible?

MaybeNotImplemented means that the method might return Python's NotImplemented.  If the
method might return that then we'll need to check the return value, and if we did get
NotImplemented then we'll need to call the reverse method.  For example if we're doing 
a + b and a.__add__ might return NotImplemented then we need to also generate code 
to do b.__radd__(a).  But if we know that it'll never return NotImplemented (either because
the type isn't object, or because it's a built-in function not decorated with this method) then we
can skip the extra code gen.

If there's no workaround you could make this say that it might always return NotImplemented.  
That'll cause some extra code gen but everything should still be correct.  But 
ReturnTypeCustomAttributes does seem to be supported in the portable class library, so maybe 
that'll work?





More information about the Ironpython-users mailing list