A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005580.html below:

[Python-Dev] Comparison inconsistency with ExtensionClass

[Python-Dev] Comparison inconsistency with ExtensionClass [Python-Dev] Comparison inconsistency with ExtensionClassGuido van Rossum guido@beopen.com
Thu, 06 Jul 2000 10:32:32 -0500
[JimF]
> Technically, this *is* a bug in ExtensionClass, however, Python
> *does* deserve some of the blame. The intepreter actually uses the
> following rule:
> 
>   Instances of two different "python types" are not compared
>   using type-supplied comparison methods unless:
> 
>   - At least one of the types is InstanceType or
> 
>   - Both of the types are numeric.
> 
> This rule is rather inconvenient for ExtensionClass.
> It's also pretty inconvenient for non-ExtensionClass
> non-numeric extension types that want to be comparable with 
> other things.
> 
> You can work around this by making your ExtensionClass a numeric
> type. This should be possible by providing a numeric method.

Without having investigated all the details of this thread, I suspect
that all of this ought to be rethought when we do rich comparisons and
revamp coercions.  I'd say that would be a good project for Python
2.1...  (Which most of the Zopers probably still know as 1.7. :-)

--Guido van Rossum (home page: http://dinsdale.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4