You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- We use id(code) to key into _moduleless - this is cheap to resolve, and
there is minimal chance of collision.
- We store hash(code) into a list as value. In the rare event we store
the same id for different code objects over time, this hash should
distinguish.
Note: 'is' comparison to a weakref would be always correct and
cleaner. However, tests show such implementations have worse
performance, O(N) where N = len(sys.modules). The implementation
here is O(1).
0 commit comments