You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code snippet
For additional context: Importing from types outside of the TYPE_CHECKING block doesn't trigger this. However, I'd prefer not actually importing that at runtime, since it can be expensive. Curious if this kind of case is in scope for this rule.
core\utils\_test.py:22:20: PYI036 The third argument in`__exit__` should be annotated with `object` or `types.TracebackType | None`
Found 1 error.
Relevant pyproject.toml Sections
Use of the --isolated and --select flags above makes this redundant, I think? If not, I will update to include them, though the only seemingly relevant thing is PYI's presence in the select list.
Version
ruff 0.2.0
The text was updated successfully, but these errors were encountered:
While that's true, I would rather not break type introspection for tools like typing.get_type_hints(). Having something in the type checking block's else clause prevents that, even if the type isn't exactly right. Hoping there's a "best of both worlds" option here, where I can not break that and have ruff's rule recognize what's happening here. If not, though, I understand.
I am running into this bug when importing the types inside a type-checking block & using quoted annotations rather than from __future__ import annotations. A resolution for this bug would be appreciated
Code snippet
For additional context: Importing from
types
outside of theTYPE_CHECKING
block doesn't trigger this. However, I'd prefer not actually importing that at runtime, since it can be expensive. Curious if this kind of case is in scope for this rule.Invoked Command
Output:
Relevant pyproject.toml Sections
Use of the
--isolated
and--select
flags above makes this redundant, I think? If not, I will update to include them, though the only seemingly relevant thing isPYI
's presence in theselect
list.Version
ruff 0.2.0
The text was updated successfully, but these errors were encountered: