@@ -1278,7 +1278,7 @@ def check_overlapping_op_methods(self,
12781278 reverse_class , reverse_name ,
12791279 forward_base , forward_name , context )
12801280 elif isinstance (forward_item , Overloaded ):
1281- for item in forward_item .items () :
1281+ for item in forward_item .items :
12821282 if self .is_unsafe_overlapping_op (item , forward_base , reverse_type ):
12831283 self .msg .operator_method_signatures_overlap (
12841284 reverse_class , reverse_name ,
@@ -1584,7 +1584,7 @@ def get_op_other_domain(self, tp: FunctionLike) -> Optional[Type]:
15841584 return tp .arg_types [0 ]
15851585 return None
15861586 elif isinstance (tp , Overloaded ):
1587- raw_items = [self .get_op_other_domain (it ) for it in tp .items () ]
1587+ raw_items = [self .get_op_other_domain (it ) for it in tp .items ]
15881588 items = [it for it in raw_items if it ]
15891589 if items :
15901590 return make_simplified_union (items )
@@ -1683,13 +1683,13 @@ def erase_override(t: Type) -> Type:
16831683 # (in that order), and if the child swaps the two and does f(str) -> str and
16841684 # f(int) -> int
16851685 order = []
1686- for child_variant in override .items () :
1687- for i , parent_variant in enumerate (original .items () ):
1686+ for child_variant in override .items :
1687+ for i , parent_variant in enumerate (original .items ):
16881688 if is_subtype (child_variant , parent_variant ):
16891689 order .append (i )
16901690 break
16911691
1692- if len (order ) == len (original .items () ) and order != sorted (order ):
1692+ if len (order ) == len (original .items ) and order != sorted (order ):
16931693 self .msg .overload_signature_incompatible_with_supertype (
16941694 name , name_in_super , supertype , override , node )
16951695 emitted_msg = True
@@ -2431,7 +2431,7 @@ def lvalue_type_from_base(self, expr_node: Var,
24312431 OverloadedFuncDef ):
24322432 # Same for properties with setter
24332433 if base_node .is_property :
2434- base_type = base_type .items () [0 ].ret_type
2434+ base_type = base_type .items [0 ].ret_type
24352435
24362436 return base_type , base_node
24372437
@@ -3524,7 +3524,7 @@ def check_except_handler_test(self, n: Expression) -> Type:
35243524 continue
35253525
35263526 if isinstance (ttype , FunctionLike ):
3527- item = ttype .items () [0 ]
3527+ item = ttype .items [0 ]
35283528 if not item .is_type_obj ():
35293529 self .fail (message_registry .INVALID_EXCEPTION_TYPE , n )
35303530 return AnyType (TypeOfAny .from_error )
@@ -5496,7 +5496,7 @@ def get_isinstance_type(expr: Expression,
54965496 if isinstance (typ , FunctionLike ) and typ .is_type_obj ():
54975497 # Type variables may be present -- erase them, which is the best
54985498 # we can do (outside disallowing them here).
5499- erased_type = erase_typevars (typ .items () [0 ].ret_type )
5499+ erased_type = erase_typevars (typ .items [0 ].ret_type )
55005500 types .append (TypeRange (erased_type , is_upper_bound = False ))
55015501 elif isinstance (typ , TypeType ):
55025502 # Type[A] means "any type that is a subtype of A" rather than "precisely type A"
@@ -5669,9 +5669,9 @@ def is_more_general_arg_prefix(t: FunctionLike, s: FunctionLike) -> bool:
56695669 ignore_return = True )
56705670 elif isinstance (t , FunctionLike ):
56715671 if isinstance (s , FunctionLike ):
5672- if len (t .items ()) == len (s .items () ):
5672+ if len (t .items ) == len (s .items ):
56735673 return all (is_same_arg_prefix (items , itemt )
5674- for items , itemt in zip (t .items () , s .items () ))
5674+ for items , itemt in zip (t .items , s .items ))
56755675 return False
56765676
56775677
@@ -6034,13 +6034,13 @@ def is_untyped_decorator(typ: Optional[Type]) -> bool:
60346034 method = typ .type .get_method ('__call__' )
60356035 if method :
60366036 if isinstance (method .type , Overloaded ):
6037- return any (is_untyped_decorator (item ) for item in method .type .items () )
6037+ return any (is_untyped_decorator (item ) for item in method .type .items )
60386038 else :
60396039 return not is_typed_callable (method .type )
60406040 else :
60416041 return False
60426042 elif isinstance (typ , Overloaded ):
6043- return any (is_untyped_decorator (item ) for item in typ .items () )
6043+ return any (is_untyped_decorator (item ) for item in typ .items )
60446044 return True
60456045
60466046
0 commit comments