|
27 | 27 | from pytype.abstract import _function_base # pylint: disable=g-bad-import-order,g-import-not-at-top |
28 | 28 | from pytype.abstract import _interpreter_function # pylint: disable=g-bad-import-order,g-import-not-at-top |
29 | 29 | from pytype.abstract import _typing # pylint: disable=g-bad-import-order,g-import-not-at-top |
30 | | - from pytype.abstract import abstract as _abstract # pylint: disable=g-import-not-at-top, g-bad-import-order |
| 30 | + from pytype.abstract import abstract as _abstract # pylint: disable=g-import-not-at-top,g-bad-import-order |
31 | 31 | else: |
32 | | - _abstract = abstract_utils._abstract # pylint: disable=protected-access |
| 32 | + _abstract = abstract_utils._abstract # pylint: disable=protected-access,g-import-not-at-top,g-bad-import-order |
33 | 33 |
|
34 | 34 | log: logging.Logger = logging.getLogger(__name__) |
35 | 35 |
|
@@ -130,7 +130,7 @@ def __init__( |
130 | 130 | name: str, |
131 | 131 | bases: list[cfg.Variable], |
132 | 132 | members: dict[str, cfg.Variable], |
133 | | - cls: _base.BaseValue, |
| 133 | + cls: class_mixin.Class, |
134 | 134 | first_opcode: opcodes.Opcode | None, |
135 | 135 | undecorated_methods: class_mixin.FunctionMapType | None, |
136 | 136 | ctx: "context.Context", |
@@ -332,7 +332,7 @@ def instantiate( |
332 | 332 | container: ( |
333 | 333 | _instance_base.SimpleValue | abstract_utils.DummyContainer | None |
334 | 334 | ) = None, |
335 | | - ): |
| 335 | + ) -> cfg.Variable: |
336 | 336 | if self.ctx.vm.current_opcode: |
337 | 337 | return self._new_instance(container, node, None).to_variable(node) |
338 | 338 | else: |
@@ -609,9 +609,9 @@ def _new_instance( |
609 | 609 | _instance_base.SimpleValue | abstract_utils.DummyContainer | None |
610 | 610 | ), |
611 | 611 | node: cfg.CFGNode, |
612 | | - args: function.Args, |
| 612 | + args: function.Args | None, |
613 | 613 | ) -> _instance_base.Instance | _instances.Tuple: |
614 | | - if self.full_name == "builtins.tuple" and args.is_empty(): |
| 614 | + if self.full_name == "builtins.tuple" and args.is_empty(): # pytype: disable=attribute-error |
615 | 615 | value = _instances.Tuple((), self.ctx) |
616 | 616 | else: |
617 | 617 | value = _instance_base.Instance( |
|
0 commit comments