diff --git a/mypy/plugin.py b/mypy/plugin.py index 74dc99b7bd98..ed2d80cfaf29 100644 --- a/mypy/plugin.py +++ b/mypy/plugin.py @@ -119,7 +119,7 @@ class C: pass semantic analyzer is enabled (it's always true in mypy 0.730 and later). """ -from abc import abstractmethod, abstractproperty +from abc import abstractmethod from typing import Any, Callable, List, Tuple, Optional, NamedTuple, TypeVar, Dict from mypy_extensions import trait, mypyc_attr @@ -214,7 +214,8 @@ class CheckerPluginInterface: path = None # type: str # Type context for type inference - @abstractproperty + @property + @abstractmethod def type_context(self) -> List[Optional[Type]]: """Return the type context of the plugin""" raise NotImplementedError @@ -348,7 +349,8 @@ def defer(self) -> None: """ raise NotImplementedError - @abstractproperty + @property + @abstractmethod def final_iteration(self) -> bool: """Is this the final iteration of semantic analysis?""" raise NotImplementedError diff --git a/mypy/semanal_shared.py b/mypy/semanal_shared.py index c040fee4e7d7..44262371253c 100644 --- a/mypy/semanal_shared.py +++ b/mypy/semanal_shared.py @@ -1,6 +1,6 @@ """Shared definitions used by different parts of semantic analysis.""" -from abc import abstractmethod, abstractproperty +from abc import abstractmethod from typing import Optional, List, Callable from typing_extensions import Final @@ -67,7 +67,8 @@ def is_incomplete_namespace(self, fullname: str) -> bool: """Is a module or class namespace potentially missing some definitions?""" raise NotImplementedError - @abstractproperty + @property + @abstractmethod def final_iteration(self) -> bool: """Is this the final iteration of semantic analysis?""" raise NotImplementedError @@ -156,7 +157,8 @@ def parse_bool(self, expr: Expression) -> Optional[bool]: def qualified_name(self, n: str) -> str: raise NotImplementedError - @abstractproperty + @property + @abstractmethod def is_typeshed_stub_file(self) -> bool: raise NotImplementedError