Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

> What am I missing? Why is the hash of the name needed?

To speed up the call to get the method from the dictionary using 
_PyDict_GetItem_KnownHash. The reason I was not caching the method is that as 
you mention there could still be an overriding value in the dictionary.

> But what if we only did this for classes without an instance dict? 

This is an interesting idea. For PR23503 seems that the machinery was too 
costly that it was killing the advantages, but maybe we could simplify this for 
classes without dictionaries so we can still gain overall.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42115>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to