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

fix the __init__ of several C-classes #13211

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Dec 6, 2024

Issues surfaced by my proposed to changes to stubtest in python/mypy#18259.

All the types changing from __init__ to __new__ is because at runtime their __init__ is from object. My comment here gives an example of a situation where that matters: python/mypy#18259 (comment)

This comment has been minimized.

@@ -189,7 +189,6 @@ class Context:
clamp: int | None = ...,
flags: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
traps: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
_ignored_flags: list[_TrapType] | None = ...,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one happened because this is an argument for _pydecimal.Context, but we should follow the C implementation here.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@tungol tungol marked this pull request as ready for review December 7, 2024 12:40
Copy link
Contributor

github-actions bot commented Dec 7, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

1 participant