Skip to content

Make ZipFile.__enter__ return self - #5675

Merged
srittau merged 2 commits into
masterfrom
JelleZijlstra-patch-1
Jun 22, 2021
Merged

srittau merged 2 commits into
masterfrom
JelleZijlstra-patch-1

Conversation

@JelleZijlstra

Copy link
Copy Markdown
Member

No description provided.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@srittau
srittau merged commit 73b4c21 into master Jun 22, 2021
@srittau
srittau deleted the JelleZijlstra-patch-1 branch June 22, 2021 15:01
@srittau

srittau commented Jun 22, 2021

Copy link
Copy Markdown
Collaborator

I suggest that in the future we shouldn't accept __enter__() methods returning self anymore that don't use a type var.

@JelleZijlstra

Copy link
Copy Markdown
Member Author

Yes, and perhaps we can audit the existing ones. git grep 'def __enter__(self) -> [A-Z]' shows a number of candidates.

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.

3 participants