Skip to content

Check for pseudo-Protocols in argument types #508

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

Open
srittau opened this issue May 13, 2025 · 0 comments
Open

Check for pseudo-Protocols in argument types #508

srittau opened this issue May 13, 2025 · 0 comments

Comments

@srittau
Copy link
Member

srittau commented May 13, 2025

There are a few ABCs that look deceptively like protocols, but aren't, for example Sequence or Mapping. We usually have good protocol alternatives for these in typeshed, but it's easy to slip in one of these pseudo-protocols by accident. Edit: It makes sense to at least explicitly acknowledge the intentional use of these by adding a # noqa comment.

We should warn about using these in argument types, but probably as an opt-in warning (which we could eventually enable in typeshed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant