20
20
from re import Pattern
21
21
from typing import TYPE_CHECKING , Any , Union
22
22
23
+ import astroid
23
24
import astroid .exceptions
24
25
import astroid .helpers
25
26
from astroid import bases , nodes
@@ -1902,12 +1903,12 @@ def _detect_unsupported_alternative_union_syntax(self, node: nodes.BinOp) -> Non
1902
1903
if not allowed_nested_syntax :
1903
1904
self ._check_unsupported_alternative_union_syntax (node )
1904
1905
1905
- def _includes_version_compatible_overload (self , attrs : list [ nodes . NodeNG ] ):
1906
+ def _includes_version_compatible_overload (self , attrs : list ):
1906
1907
"""Check if a set of overloads of an operator includes one that
1907
1908
can be relied upon for our configured Python version.
1908
1909
1909
1910
If we are running under a Python 3.10+ runtime but configured for
1910
- pre-3.10 compatibility then Astroid will ahve inferred the
1911
+ pre-3.10 compatibility then Astroid will have inferred the
1911
1912
existence of __or__ / __ror__ on builtins.type, but these aren't
1912
1913
available in the configured version of Python.
1913
1914
"""
@@ -1916,7 +1917,7 @@ def _includes_version_compatible_overload(self, attrs: list[nodes.NodeNG]):
1916
1917
and attr .parent .qname () == "builtins.type"
1917
1918
for attr in attrs
1918
1919
)
1919
- return ( not is_py310_builtin ) or self ._py310_plus
1920
+ return not is_py310_builtin or self ._py310_plus
1920
1921
1921
1922
def _check_unsupported_alternative_union_syntax (self , node : nodes .BinOp ) -> None :
1922
1923
"""Check if left or right node is of type `type`.
0 commit comments