2 ms·
> mapping a string (slot name) to an index [in an overdynamic language like Python] does require a dictionary lookup Yes, you're right, I wasn't clear enough.
by pdonis 6y ago
> mapping a string (slot name) to an index [in an overdynamic language like Python] does require a dictionary lookup
Yes, you're right, I wasn't clear enough. What I meant to say was that accessing the value of the slot attribute (to either get or set it) on the instance does not require a dictionary lookup, just an array access. But of course finding out that the string (attribute name) is the name of a slot and getting the slot index does require a dictionary lookup (on the class, as you say).