[-] JATothrim_v2@programming.dev 2 points 4 hours ago

~~demons~~ ahem. data-races.

[-] JATothrim_v2@programming.dev 7 points 1 week ago

For immutable types it is the same though.

The most twisted thing I learned is that all ints below a fixed limit share the same id() result, so

>>> x = 1
>>> id(x)
135993914337648
>>> y = 1
>>> id(y)
135993914337648

But then suddenly:

>>> x = 1000000
>>> id(x)
135993893250992
>>> y = 1000000
>>> id(y)
135993893251056

Using id() as a key in dict() may get you into trouble.

JATothrim_v2

joined 4 weeks ago