diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-06-29 13:55:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-29 13:55:03 +0200 |
| commit | d6ec440c5b941e1fd368ef2a60969591d13b0e32 (patch) | |
| tree | 157637db391cb534192014816000ab8bfa25e0a9 | |
| parent | 213b2a6a8b9591830f1e9fada097ba7c33690b79 (diff) | |
| download | astroid-git-d6ec440c5b941e1fd368ef2a60969591d13b0e32.tar.gz | |
Add typing to ``Proxy._proxied`` (#1673)
| -rw-r--r-- | astroid/bases.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/astroid/bases.py b/astroid/bases.py index 909ead4d..e20d912a 100644 --- a/astroid/bases.py +++ b/astroid/bases.py @@ -105,9 +105,13 @@ class Proxy: if new instance attributes are created. See the Const class """ - _proxied = None # proxied object may be set by class or by instance + _proxied: nodes.ClassDef | nodes.Lambda | Proxy | None = ( + None # proxied object may be set by class or by instance + ) - def __init__(self, proxied=None): + def __init__( + self, proxied: nodes.ClassDef | nodes.Lambda | Proxy | None = None + ) -> None: if proxied is not None: self._proxied = proxied @@ -430,7 +434,7 @@ class UnboundMethod(Proxy): node_context = context.extra_context.get(caller.args[0]) infer = caller.args[0].infer(context=node_context) - yield from (Instance(x) if x is not Uninferable else x for x in infer) # type: ignore[misc] + yield from (Instance(x) if x is not Uninferable else x for x in infer) # type: ignore[misc,arg-type] def bool_value(self, context=None): return True |
