python language: infimum and supremum of integers

Andrew Dalke adalke at mindspring.com
Wed Apr 23 22:43:41 EDT 2003


Charlie Reiman:
> Are there any dangers in something like this:
>
> a = [1, infimum, infimum]
> a.sort()
>
> Should the __cmp__ methods return 0 for equality (identity, in this
> case)?

As Alex pointed out, it should.

However, I recall a post by Tim Peters some years ago saying
that he fixed the sort code so it would finish, even in the face of
absurdities like this.

But I'm too lazy to find the post, or even test the code.  ;)

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list