Make `id()` useful

Nah, infinite memory is not necessary.

Then I think I’ve missed something. If I have mapping of int →object, that would mean every key is a python object. So that same key should be found as a value by itself in the mapping (under id(key)).

But that would also mean I should find id(key) itself in the mapping (under id(id(key))) and so on and so on.

So how can I represent such a mapping in python without going to infinity?

2 Likes

Author edited original post to move discussion to Add ability to use `id(obj)` to get `obj`