Skip to content

TYP: contextmanager expects a Generator #48383

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 6, 2022
Merged

TYP: contextmanager expects a Generator #48383

merged 1 commit into from
Sep 6, 2022

Conversation

twoertwein
Copy link
Member

contextmanager should expect a Generator, not an Iterator. Iterator[...] and Generator[..., None, None] are not the same, see python/typeshed#2772

This might help @asottile a bit with python/typeshed#7430. Basically, staled because it would impact too many projects - after this PR there is one fewer :)

@twoertwein twoertwein added the Typing type annotations, mypy/pyright type checking label Sep 4, 2022
@mroeschke mroeschke added this to the 1.6 milestone Sep 6, 2022
@mroeschke mroeschke merged commit 6f8ab49 into pandas-dev:main Sep 6, 2022
@mroeschke
Copy link
Member

Thanks @twoertwein (would be cool if autotyping could have a rule for this :) )

@twoertwein twoertwein deleted the context branch September 10, 2022 01:38
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants