[Python-Dev] Comparison inconsistency with ExtensionClass
Barry A. Warsaw
bwarsaw@beopen.com
Thu, 6 Jul 2000 10:55:36 -0400 (EDT)
>>>>> "JF" == Jim Fulton <jim@digicool.com> writes:
JF> Instances of two different "python types" are not compared
JF> using type-supplied comparison methods unless:
JF> - At least one of the types is InstanceType or
JF> - Both of the types are numeric.
JF> This rule is rather inconvenient for ExtensionClass.
JF> It's also pretty inconvenient for non-ExtensionClass
JF> non-numeric extension types that want to be comparable with
JF> other things.
I ran into this problem when trying to translate a simple Boolean
class into a built-in type. I basically could not get the comparisons
to work correctly when I moved to C. So I'm +1 on fixing this at some
point (probably as Guido points out, when we add rich comparisons).
-Barry