19.09.19 11:00, Greg Ewing пише:
Serhiy Storchaka wrote:
PyDict_Merge() is called every time when you have a call like `f(a=1, **kw)`

So would not be worth to add slots for keys (and maybe for values and items) to the tp_as_mapping structure?

Only if looking up those methods is taking a substantial proportion
of time. Measurements will be needed to find out.

I withdraw my proposition. "keys" is not a dunder name, so it should be looked up in the instance, not in the class. It can't be cached.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/IQ252ME3RS2HX43ZTCIWR3T63KS4HF52/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to