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/2005-December/059160.html below:

[Python-Dev] Keep default comparisons - or add a second set?

[Python-Dev] Keep default comparisons - or add a second set? [Python-Dev] Keep default comparisons - or add a second set?Scott David Daniels Scott.Daniels at Acm.Org
Wed Dec 28 07:53:37 CET 2005
Jim Jewett wrote:
> Jim Fulton asked how this canonical ordering
> should be defined.
> 
> The obvious answer is "Just like the __lt__
> operator today".   But it doesn't actually *need*
> to be that sensible, if there are strong reasons
> to prefer a simpler ordering.
> 
> The more I think about it, though, __eq__ really
> does need to be honored; I don't want an
>     "Are these two containers equivalent?"
> test to depend on how well the memory
> subsystem happened to be working.
> 
> Given that, also honoring an explicit __lt__
> isn't much of an extra burden, and will make
> the ordering much more useful for debugging
> and output.

Tell me:
 >>> a = [0] * 3
 >>> b = [0] * 3
 >>> a[0] = b
 >>> b[0] = a

What order should a and b have?

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-Dev mailing list

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