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

fix: Wrapped annotations with subscripted types should not raise TC201 #166

Conversation

Daverball
Copy link
Collaborator

Fixes #164

Copy link
Member

@sondrelg sondrelg left a comment

Choose a reason for hiding this comment

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

Very nice 👌 I'll release a new version today

'''),
from __future__ import annotations
class X:
def foo(self) -> 'X':
Copy link
Member

Choose a reason for hiding this comment

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

I guess this wasn't changed, but I'm a bit stumped as to why this shouldn't produce a TC201

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is correct, this should only avoid producing a TC101. The TC20x rules don't care about from __future__ import annotations.

@sondrelg sondrelg merged commit 21dafca into snok:main Oct 5, 2023
5 of 6 checks passed
@Daverball Daverball deleted the fix/tc201-false-positives-for-subscriptable-types branch October 5, 2023 14:32
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.

TC201 false positives for generics that are not generic at runtime
2 participants