typing: use forward reference for types defined later in file

pull/10248/head
Eli Schwartz 3 years ago
parent 9b17dd4f56
commit e5c7dc199a
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      mesonbuild/interpreterbase/baseobjects.py

@ -28,10 +28,10 @@ if T.TYPE_CHECKING:
# Object holders need the actual interpreter
from ..interpreter import Interpreter
__T = T.TypeVar('__T', bound=TYPE_var, contravariant=True)
__T = T.TypeVar('__T', bound='TYPE_var', contravariant=True)
class OperatorCall(Protocol[__T]):
def __call__(self, other: __T) -> TYPE_var: ...
def __call__(self, other: __T) -> 'TYPE_var': ...
TV_fw_var = T.Union[str, int, bool, list, dict, 'InterpreterObject']
TV_fw_args = T.List[T.Union[mparser.BaseNode, TV_fw_var]]

Loading…
Cancel
Save