8000 Fix tests stubs by isra17 · Pull Request #140 · maxfischer2781/asyncstdlib · GitHub
[go: up one dir, main page]

Skip to content

Fix tests stubs #140

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

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

isra17
Copy link
Contributor
@isra17 isra17 commented Apr 3, 2024

The current typing yield the following error:

error: "Coroutine[Any, Any, AsyncIterator[Any]]" has no attribute "__aiter__" (not async iterable)  [attr-defined]

Related to python/mypy#10301

I also took time to add a typing test for every function in itertools that validate the iterator type. I added a dependency to mypy-type-assets to easily assert the type.

@isra17 isra17 force-pushed the fix-itertools-types branch from 859abc4 to 3943ece Compare April 3, 2024 15:16
@isra17 isra17 force-pushed the fix-itertools-types branch from 3943ece to 862682a Compare April 3, 2024 15:16
@maxfischer2781 maxfischer2781 self-requested a review April 4, 2024 07:27
@maxfischer2781
Copy link
Owner

Good catch. I'll try and review this ASAP.

@maxfischer2781
Copy link
Owner

As a first glance, can you switch from the MyPy assertion plugin to using typing.assert_type (import it from typing_extensions)? The type checks should also work for PyRight, so a general means is preferable.

@isra17 isra17 force-pushed the fix-itertools-types branch from 862682a to 86f8633 Compare April 4, 2024 14:03
@isra17
Copy link
Contributor Author
isra17 commented Apr 4, 2024

As a first glance, can you switch from the MyPy assertion plugin to using typing.assert_type (import it from typing_extensions)? The type checks should also work for PyRight, so a general means is preferable.

I wasn't aware of this new function, done!

Copy link
Owner
@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

Looks good. The only thing left to do is cleanup of unused dependencies.

Co-authored-by: Max Fischer <maxfischer2781@gmail.com>
@isra17
Copy link
Contributor Author
isra17 commented Apr 9, 2024

Looks good. The only thing left to do is cleanup of unused dependencies.

Sorry, forgot to clean up, done

@isra17 isra17 force-pushed the fix-itertools-types branch from 54a00b7 to d6e4ca9 Compare April 9, 2024 20:31
Copy link
Owner
@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

This is good to go. Thanks for spotting this issue and for your contribution! 👍

@maxfischer2781 maxfischer2781 merged commit aaeb6d7 into maxfischer2781:master Apr 11, 2024
< 723F svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-cross-reference">
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.

2 participants
0