From 2fe72b977506562811d3b4dce1c138f0a69f7ad4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 18 Nov 2021 13:39:54 -0500 Subject: [PATCH] use typing.Dict newer Pythons seem to accept ``dict[Any, Any]`` which is why this wasn't noticed. Revise fix for #7321 made in I55656e867876677c5c55143449db371344be8600. Fixes: #7321 Change-Id: Idc22e15d098543e07853f4532cfd1aaae4dd6404 --- test/ext/mypy/files/issue_7321.py | 5 +++-- test/ext/mypy/files/issue_7321_part2.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/ext/mypy/files/issue_7321.py b/test/ext/mypy/files/issue_7321.py index 6a40b9ddaa..d4cd7f2c43 100644 --- a/test/ext/mypy/files/issue_7321.py +++ b/test/ext/mypy/files/issue_7321.py @@ -1,4 +1,5 @@ from typing import Any +from typing import Dict from sqlalchemy.orm import declarative_base from sqlalchemy.orm import declared_attr @@ -13,9 +14,9 @@ class Foo(Base): return "name" @declared_attr - def __mapper_args__(cls) -> dict[Any, Any]: + def __mapper_args__(cls) -> Dict[Any, Any]: return {} @declared_attr - def __table_args__(cls) -> dict[Any, Any]: + def __table_args__(cls) -> Dict[Any, Any]: return {} diff --git a/test/ext/mypy/files/issue_7321_part2.py b/test/ext/mypy/files/issue_7321_part2.py index f53add1da9..4227f2797e 100644 --- a/test/ext/mypy/files/issue_7321_part2.py +++ b/test/ext/mypy/files/issue_7321_part2.py @@ -1,4 +1,5 @@ from typing import Any +from typing import Dict from typing import Type from sqlalchemy.orm import declarative_base @@ -16,12 +17,12 @@ class Foo(Base): return "name" @declared_attr - def __mapper_args__(cls: Type["Foo"]) -> dict[Any, Any]: + def __mapper_args__(cls: Type["Foo"]) -> Dict[Any, Any]: return {} # this was a workaround that works if there's no plugin present, make # sure that doesn't crash anything @classmethod @declared_attr - def __table_args__(cls: Type["Foo"]) -> dict[Any, Any]: + def __table_args__(cls: Type["Foo"]) -> Dict[Any, Any]: return {} -- 2.47.2