diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2023-04-03 21:46:40 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2023-04-03 22:22:40 +0200 |
commit | 2e30401f7c14fe3b5b425abf06538f4645aa61f1 (patch) | |
tree | 9fa0713c6fd9bdde7782449c159e6d682e184380 /astroid | |
parent | 953c13b0759d7a9ff86a34248e55a1219165390d (diff) | |
download | astroid-git-2e30401f7c14fe3b5b425abf06538f4645aa61f1.tar.gz |
Broaden signatures of methods of classes that are subclassed
Diffstat (limited to 'astroid')
-rw-r--r-- | astroid/bases.py | 6 | ||||
-rw-r--r-- | astroid/nodes/node_ng.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/astroid/bases.py b/astroid/bases.py index e5fd2a7f..5a6c46d0 100644 --- a/astroid/bases.py +++ b/astroid/bases.py @@ -418,10 +418,10 @@ class UnboundMethod(Proxy): self.__class__.__name__, self._proxied.name, frame.qname(), id(self) ) - def implicit_parameters(self) -> Literal[0]: + def implicit_parameters(self) -> Literal[0, 1]: return 0 - def is_bound(self) -> Literal[False]: + def is_bound(self) -> bool: return False def getattr(self, name, context: InferenceContext | None = None): @@ -640,7 +640,7 @@ class Generator(BaseInstance): def callable(self) -> Literal[False]: return False - def pytype(self) -> Literal["builtins.generator"]: + def pytype(self) -> str: return "builtins.generator" def display_type(self) -> str: diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py index b8cec741..e21a2808 100644 --- a/astroid/nodes/node_ng.py +++ b/astroid/nodes/node_ng.py @@ -809,6 +809,6 @@ class NodeNG: # Look up by class name or default to highest precedence return OP_PRECEDENCE.get(self.__class__.__name__, len(OP_PRECEDENCE)) - def op_left_associative(self) -> Literal[True]: + def op_left_associative(self) -> bool: # Everything is left associative except `**` and IfExp return True |