memesearch
Python Integer Hashing Quirk

Python Integer Hashing Quirk

Download Find similar pictures
Text on the meme
Integers For ordinary integers, the hash value is simply the integer itself (unless it’s -1). class int: def __hash__(self): value = self if value == -1: value = -2 return value For long Python integers, things are a little trickier. For
What it means

A cropped programming reference explains how Python hashes ordinary integers, showing that -1 is changed to -2 because -1 has a special meaning internally. The joke is aimed at Python developers reacting to an unintuitive language implementation detail. EN: A cropped programming reference explains how Python hashes ordinary integers, showing that -1 is changed to -2 because -1 has a special meaning internally. The joke is aimed at Python developers reacting to an unintuitive language implementation detail.

Objects
Tags
Source
Type
image
Size
800×419 · 37.9 KiB
Mood
absurd, sarcastic
Language
en
Added