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

update inspect.pyi to use typevars with generics #5658

Closed
wants to merge 6 commits into from

Conversation

Zomatree
Copy link

Updated some inspect.is* function to use typevars with the generics when a typeguard is involved.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Zomatree
Copy link
Author

Seems like this is stuck on ParamSpec support in mypy.

@srittau srittau added the status: deferred Issue or PR deferred until some precondition is fixed label Jun 17, 2021
stdlib/inspect.pyi Outdated Show resolved Hide resolved
@srittau srittau removed the status: deferred Issue or PR deferred until some precondition is fixed label Jun 17, 2021
@srittau
Copy link
Collaborator

srittau commented Jun 17, 2021

According to #4827 ParamSpec should "work" if you use # type: ignore.

stdlib/inspect.pyi Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

stdlib/inspect.pyi Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

stdlib/inspect.pyi Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2021

Diff from mypy_primer, showing the effect of this PR on open source code:

graphql-core (https://github.com/graphql-python/graphql-core.git)
- src/graphql/subscription/subscribe.py:89: error: unused "type: ignore" comment
- tests/execution/test_sync.py:61: error: Redundant cast to "Awaitable[Any]"

paasta (https://github.com/yelp/paasta.git)
+ paasta_tools/deployd/master.py:115: error: Incompatible return value type (got "List[Type[_T]]", expected "List[Type[PaastaWatcher]]")

@JelleZijlstra
Copy link
Member

You'll need to sprinkle in some # type: ignores to keep mypy happy.

@JelleZijlstra
Copy link
Member

This has a lot of conflicts now. I think much of this change was implemented in other PRs.

@JelleZijlstra
Copy link
Member

Going to close this as stale for now to keep the list of open PRs manageable. If you're still interested in seeing this through, feel free to reopen or open a new PR.

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

5 participants