[Ironpython-users] Conversions from pure-Python types to .NET types
jdhardy at gmail.com
Sat May 11 08:39:11 CEST 2013
On Fri, May 10, 2013 at 1:10 AM, Vernon D. Cole <vernondcole at gmail.com> wrote:
> Sounds simple, clean, and gives an expected result. I like the idea of
> using "NotImplemented".
> I almost like the idea of raising NotImplementedError better (it would be
> a noisier failure) but the documentation might lead the unwary away from the
> problem (a failed implicit conversion) rather than toward it, so the
> returned value is probably better.
Well, failure is going to be pretty common, so I don't want it to be
too noisy. I haven't completely figured out the proper conversion
order but I think __clr_convert__ will have to first, and then
__int__, __str__, etc. In addition, using the same idiom as __lt__ et
al. should make it at least familiar.
More information about the Ironpython-users