Skip to content

Replace @abstractproperty usage in mypy #8310

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

Merged
merged 1 commit into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions mypy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions mypy/semanal_shared.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down