Python Identity Comparison Confusion
What is wrong ? a = 256 b = 256 a is b True a = 257 b = 257 a is b False
A programming screenshot shows Python comparing whether two separately assigned integers are the same object. The joke is that Python may intern small or commonly used integers, making `a is b` unexpectedly return True for 256 but False for 257; it is shared as a humorous reaction to Python’s unintuitive behavior.
- @ithueti / 10708 2023-10-29
- @dev_meme / 5610 2023-10-29
- Type
- image
- Size
- 619×800 · 34.6 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added