On Tue, Aug 30, 2022 at 03:28:06PM -0400, Wes Turner wrote:
> - Copying __qual/name__ would definitely be a performance regression
Doubtful that it would be meaningful. It's just a lookup and assignment.
>From the perspective of the partial object, it's just
self.__name__ = func.__name__
(give or take), and that's not likely to be expensive, especially if
implemented in C as I think partial objects are.
The string itself doesn't have to be copied, just the reference to it,
which is fast. And its just a once-off cost for creating the partial
object, it isn't going to slow down calling them.
Even if the cost of this is measurable, it is unlikely to be significant
to anyone unless their entire app is just creating millions of partial
objects without actually calling them or using them in any way.
--
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/EVF5OM53KWWBCFXTFP2APDC4DXRFTGDV/
Code of Conduct: http://python.org/psf/codeofconduct/