-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-110782: Fix crash when TypeVar is constructed with keyword args #110784
Conversation
JelleZijlstra
commented
Oct 12, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: [Regression] TypeVar crashes when name is specified via keyword parameters #110782
@@ -554,6 +554,12 @@ def test_many_weakrefs(self): | |||
vals[x] = cls(str(x)) | |||
del vals | |||
|
|||
def test_constructor(self): | |||
T = TypeVar(name="T") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this form offensive, but since we allowed it in 3.11 I guess we have to keep supporting it, and we can't just make it an error (not crashing of course). (It's especially weird since a type var with constraints requires the name to be positional.)
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…rgs (pythonGH-110784) (cherry picked from commit d2a536b) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-110787 is a backport of this pull request to the 3.12 branch. |
…ot be `NULL`
…nts` cannot be `NULL` (#110922)
… `constraints` cannot be `NULL` (python#110922)
… `constraints` cannot be `NULL` (python#110922)