[Patches] Re: [Python-Dev] yeah! for Jeremy and Greg

bwarsaw@cnri.reston.va.us bwarsaw@cnri.reston.va.us
Wed, 29 Mar 2000 13:28:27 -0500 (EST)


>>>>> "JH" == Jeremy Hylton <jeremy@cnri.reston.va.us> writes:

    JH> I'm not sure about this patch because it has the potential to
    JH> obscure a bug in user code.  If I write a class that has an
    JH> __len__ method and that method has a bug that raises an
    JH> exception, it looks like your patch would clobber the
    JH> exception and set a new one.

    JH> Perhaps it would be better to explicitly catch the
    JH> AttributeError on __len__ and turn that into a TypeError.

As we discussed at lunch today, I concur.  It was late so I'm just
happy I was able to bat 50% on those patches :)  The one to ceval.c to
check the return value of PySequence_Length() is the key patch.  I'll
go ahead and check that one in.

-Barry