
Jan. 17, 2022
10:53 p.m.
On Mon, Jan 17, 2022 at 07:19:17AM -0800, Jelle Zijlstra wrote:
That is in the global scope, which will be much slower than a local scope.
Global builtins do a hash table lookup; local lookups just follow a pointer.
Yes, that is correct, frozenset is a builtin, not a local variable, so looking the name up does two hash table lookups: one in globals, and if the name hasn't been shadowed, a second in builtins. -- Steve