r/programming • • Aug 25 '26

EVE Online: The Move to Python 3 Begins!

https://www.eveonline.com/news/view/the-move-to-python-3-begins
797 Upvotes

290 comments sorted by

View all comments

Show parent comment

6

u/Brian Aug 25 '26

a not equal to b means that either a < b OR a > b.

Though strictly speaking, this falls down in practice, as there are types that do define equality/inequality, but don't define ordering. Eg. for complex numbers it's not true that 1+i < 2, nor that it's greater, but it's definitely not equal.

1

u/Ameisen Aug 25 '26

Yeah, i and 1 have equal magnitude but not equal values.

Likewise, in C++:

std::is_same_v<char, signed char> == false
std::is_same_v<char, unsigned char> == false
std::is_same_v<signed char, unsigned char> == false

... but

std::is_same_v<int, signed int> == true
std::is_same_v<int, unsigned int> == false
std::is_same_v<signed int, unsigned int> == false