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