Skip to content

Commit

Permalink
use type ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 23, 2024
1 parent e5ef50a commit 7004be5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mypy/test/teststubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,10 @@ class TestClass:

@unittest.skipIf(sys.version_info < (3, 12), "Inline Generics not supported before Python3.12")
def test_generic_class(self) -> None:
if sys.version_info < (
3,
12,
): # Done to prevent mypy [syntax] error on inline Generics in older versions of python
return

exec("class Test[A]: ...")

class TestClass[A]: ...
# type: ignore used for older versions of python type checking
class TestClass[A]: ... # type: ignore[invalid-syntax]

output: list[str] = []
mod = ModuleType("module", "")
Expand Down

0 comments on commit 7004be5

Please sign in to comment.