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

gzip: change type of undocumented constants #11943

Merged
merged 2 commits into from
May 18, 2024

Conversation

hauntsaninja
Copy link
Collaborator

These were changed to str in py313

These were changed to str in py313

This comment has been minimized.

READ: Literal[1] # undocumented
WRITE: Literal[2] # undocumented
READ: object # undocumented
WRITE: object # undocumented
Copy link
Member

Choose a reason for hiding this comment

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

We also need to change the type of the GzipFile.mode attribute on line 89 below. I wouldn't be opposed to adding the new exact values (rb and wb here) instead of using object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, fixed

I've kept it as object since it makes it more obvious if your code would fail cross-version (almost all users only type check on one version) / since CPython is clearly treating it as implementation detail that has changed in practice

Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit 9f35be6 into python:main May 18, 2024
54 checks passed
@hauntsaninja hauntsaninja deleted the gzip-obj branch May 18, 2024 16:43
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

2 participants