Skip to content
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-104600: Make function.__type_params__ writable #104601

Merged
merged 3 commits into from May 18, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 18, 2023

@rhettinger rhettinger removed their request for review May 18, 2023 04:05
{
/* Not legal to del f.__type_params__ or to set it to anything
* other than a tuple object. */
if (value == NULL || !PyTuple_Check(value)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to use PyTuple_CheckExact instead of PyTuple_Check? With PyTuple_Check we can pass to __type_params__ subclass of tuple. May it break something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really use the __type_params__ in the interpreter, so there's low risk. The other attributes also allow subclasses (e.g. check func_set_defaults and func_set_name).

@JelleZijlstra JelleZijlstra merged commit 3fadd7d into python:main May 18, 2023
23 checks passed
@JelleZijlstra JelleZijlstra deleted the settypeparams branch May 18, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants