[BangPypers] Python comparisons

Gora Mohanty gora at mimirtech.com
Sun Dec 6 00:27:16 EST 2015


On 5 December 2015 at 20:30, Noufal Ibrahim KV <noufal at nibrahim.net.in> wrote:
> On Sat, Dec 05 2015, Gora Mohanty wrote:
>
>
> [...]
>
>> Maybe because that was the historical way that C did it? I agree that
>> the Python 3 exception makes more sense.
>
> [...]
>
> We can only guess but you'll have to explicitly code this in and I can't
> think of any situation where it would make sense.

Well, one could make an argument that it should always be possible to
compare two objects, and at least earlier programmers would be used to
C's comparison.

Also, if one considers constant strings, these are often stored as per
a hash, so that equal strings would end up in the same memory
location, and compare equal. However, I don't think even C guarantees
such an implementation.

Regards,
Gora


More information about the BangPypers mailing list