Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
bpo-31581: Reduce the number of imports for functools #3757
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
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
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.
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