bpo-31581: Reduce the number of imports for functools#3757
Conversation
|
I added 'skip news' tag, since #1269 don't have news too. |
Sorry, something went wrong.
ncoghlan
left a comment
There was a problem hiding this comment.
The functools.singledispatch change seems reasonable to me, since the cost of checking the import cache twice will be cheap compared to the overhead of defining a new function to apply @singledispatch to.
As per the comments on the argparse PR, this should be accompanied by a comment explaining the trade-off (i.e. there are many programs that use functools without singledispatch, so we trade-off making singledispatch marginally slower for the benefit of making start-up of such applications slightly faster)
However, I'm less sure of the appropriateness of the start-up vs runtime cost trade-off for Counter.most_common, so I'd prefer to see that change in a separate PR.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
a0082b6 to
f228a84
Compare
September 26, 2017 08:47
fixed. |
Sorry, something went wrong.
Since functools and collections are very commonly used, it's worth enough to optimize import.
https://bugs.python.org/issue31581