From ca1878ffb5ba5f72dcb44ca567d48a3a0a048f1f Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Sun, 30 Aug 2020 15:34:33 +0200 Subject: typing: fix envconfig typing --- mesonbuild/envconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/envconfig.py') diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 5258fa0..1270666 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -111,7 +111,7 @@ def get_env_var_pair(for_machine: MachineChoice, def get_env_var(for_machine: MachineChoice, is_cross: bool, - var_name: str) -> T.Tuple[T.Optional[str], T.Optional[str]]: + var_name: str) -> T.Optional[str]: ret = get_env_var_pair(for_machine, is_cross, var_name) if ret is None: return None -- cgit v1.1 From e681235e5fe3ee0a40dd6a3f5922c2c4b0cf98b4 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 1 Sep 2020 19:58:10 +0200 Subject: typing: fix code review --- mesonbuild/envconfig.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/envconfig.py') diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 1270666..836ec06 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -147,7 +147,7 @@ class Properties: return p return mesonlib.listify(p) - def __eq__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': + def __eq__(self, other: object) -> 'T.Union[bool, NotImplemented]': if isinstance(other, type(self)): return self.properties == other.properties return NotImplemented @@ -172,8 +172,8 @@ class MachineInfo: self.endian = endian self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT # type: bool - def __eq__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': - if self.__class__ is not other.__class__: + def __eq__(self, other: object) -> 'T.Union[bool, NotImplemented]': + if self.__class__ is not other.__class__ or not isinstance(other, MachineInfo): return NotImplemented return \ self.system == other.system and \ @@ -181,8 +181,8 @@ class MachineInfo: self.cpu == other.cpu and \ self.endian == other.endian - def __ne__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': - if self.__class__ is not other.__class__: + def __ne__(self, other: object) -> 'T.Union[bool, NotImplemented]': + if self.__class__ is not other.__class__ or not isinstance(other, MachineInfo): return NotImplemented return not self.__eq__(other) -- cgit v1.1 From 4253bf62814997bd2c985a2a72e86c260338fb4d Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Thu, 3 Sep 2020 11:42:53 +0200 Subject: typing: Fix code review --- mesonbuild/envconfig.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/envconfig.py') diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 836ec06..3c562f3 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -147,7 +147,7 @@ class Properties: return p return mesonlib.listify(p) - def __eq__(self, other: object) -> 'T.Union[bool, NotImplemented]': + def __eq__(self, other: object) -> bool: if isinstance(other, type(self)): return self.properties == other.properties return NotImplemented @@ -172,8 +172,8 @@ class MachineInfo: self.endian = endian self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT # type: bool - def __eq__(self, other: object) -> 'T.Union[bool, NotImplemented]': - if self.__class__ is not other.__class__ or not isinstance(other, MachineInfo): + def __eq__(self, other: object) -> bool: + if not isinstance(other, MachineInfo): return NotImplemented return \ self.system == other.system and \ @@ -181,8 +181,8 @@ class MachineInfo: self.cpu == other.cpu and \ self.endian == other.endian - def __ne__(self, other: object) -> 'T.Union[bool, NotImplemented]': - if self.__class__ is not other.__class__ or not isinstance(other, MachineInfo): + def __ne__(self, other: object) -> bool: + if not isinstance(other, MachineInfo): return NotImplemented return not self.__eq__(other) -- cgit v1.1