bpo-44353: Implement typing.NewType __call__ method in C#27262
bpo-44353: Implement typing.NewType __call__ method in C#27262ambv merged 17 commits intopython:mainpython/cpython:mainfrom uriyyo:fix-issue-44353-faster-calluriyyo/cpython:fix-issue-44353-faster-callCopy head branch name to clipboard
Conversation
|
@Fidget-Spinner Could you please review this PR? |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
LGTM, but maybe we should wait for the functools maintainers in case they don't want it in that module.
Also, thanks a bunch for reviewing this too Jelle :). It's nice to have more reviewers around for typing.
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
@Fidget-Spinner feel free to request my review on other typing PRs! I don't have a strong opinion on where to put the helper function. I feel like |
|
@JelleZijlstra Yup, I agree - |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
LG. I removed Raymond from the reviewer list since this doesn't touch functools anymore.
Co-authored-by: Denis Laxalde <denis@laxalde.org>
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
Probably not. Usually only doc/bugfixes can be backported. Performance improvements are usually not backported, unless the old version has performance that was so bad it caused a security vulnerability/bug/crash (e.g. regex DOS). We are too late into the 3.10 dev cycle to backport an improvement. Also, thinking abit more, @corona10 is right about adding a separate module for this. I know I've said before that we should be conservative about adding more typing stuff in C, but if it's a small simple optimization like the current PR (which doesn't break compatibility with things like PyPy), I'm +1. In case we need to add more things in the future, it's better to create a new module now and not pollute the other modules. |
corona10
left a comment
There was a problem hiding this comment.
Once you added the accelerated module, you have to carefully manage both versions.
To manage the identical implementation within different languages, you should update unit tests to run both versions.
Please refer how other modules did.
cpython/Lib/test/test_statistics.py
Line 182 in c05a790
|
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 |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
…ter-call # Conflicts: # Lib/test/test_typing.py
corona10
left a comment
There was a problem hiding this comment.
LGTM about module architecture.
Now I am turning over reviews to typing module experts
|
@ambv: Please replace |
|
Thanks, @uriyyo! |
|
This PR was introduced reference leaks and currently all refleak buildbots are red: Example: https://buildbot.python.org/all/#/builders/205/builds/102/steps/5/logs/stdio Per our buildbot policy, if a fix is not performed in 24 h we will need to revert |
|
@pablogsal Looks like this because of this line cpython/Modules/_typingmodule.c Line 26 in 17575f7 I will open PR to fix it. UPD: that no problem of a memory leak UPD: Root cause of memory leak - #27305 (comment) |
https://bugs.python.org/issue44353