Skip to content

Commit d6ec440

Browse files
authored
Add typing to Proxy._proxied (#1673)
1 parent 213b2a6 commit d6ec440

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

astroid/bases.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ class Proxy:
105105
if new instance attributes are created. See the Const class
106106
"""
107107

108-
_proxied = None # proxied object may be set by class or by instance
108+
_proxied: nodes.ClassDef | nodes.Lambda | Proxy | None = (
109+
None # proxied object may be set by class or by instance
110+
)
109111

110-
def __init__(self, proxied=None):
112+
def __init__(
113+
self, proxied: nodes.ClassDef | nodes.Lambda | Proxy | None = None
114+
) -> None:
111115
if proxied is not None:
112116
self._proxied = proxied
113117

@@ -430,7 +434,7 @@ def _infer_builtin_new(
430434
node_context = context.extra_context.get(caller.args[0])
431435
infer = caller.args[0].infer(context=node_context)
432436

433-
yield from (Instance(x) if x is not Uninferable else x for x in infer) # type: ignore[misc]
437+
yield from (Instance(x) if x is not Uninferable else x for x in infer) # type: ignore[misc,arg-type]
434438

435439
def bool_value(self, context=None):
436440
return True

0 commit comments

Comments
 (0)