News for hackers. Stuff that matters.
Re:What the Fuck Python by mirashii on Saturday July 19, 2025 @04:15PM (#44618960)
id is not an implementation detail, it's a core built-in function of the language. The value that it returns is an implementation detail, but the properties of the value it returns are not and perfectly valid to rely on.
Re:What the Fuck Python by 0xDEAFBEAD on Sunday July 20, 2025 @03:08AM (#44622668)
The "properties of the value it returns" are, by design, implementation-dependent. You're only supposed to use the id function if you need to know something about what's going on under the hood. The id function is working exactly as intended: it's exposing aspects of the implementation, if for some reason you need to know that stuff.

It would not be a positive change to sacrifice Python performance in order to make the output of id() more intuitive. I've spent many hundreds of hours coding Python and I don't believe I ever used that function or saw someone else use it.