Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nine_k
on Feb 15, 2021
|
parent
|
context
|
favorite
| on:
Python strings are immutable, but only sometimes
This does play a role if for some reason you use object IDs, e.g. when deserializing data with cross-links. Keeping a real second reference becomes important.
wizzwizz4
on Feb 15, 2021
|
next
[–]
You should never use object IDs that way; that's what weak references / dictionaries are for. (See pickle for details.)
heavenlyblue
on Feb 15, 2021
|
prev
[–]
Python docs explicitly say that object IDs are only unique for objects with overlapping lifetimes.
Congrats, by trying to be smart you just shot yourself in the foot.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: