@@ -225,7 +225,6 @@ def __init__(
225
225
) -> None :
226
226
self .scope = Scope ()
227
227
self .type_map = type_map
228
- self .python2 = python_version [0 ] == 2
229
228
# This attribute holds a mapping from target to names of type aliases
230
229
# it depends on. These need to be processed specially, since they are
231
230
# only present in expanded form in symbol tables. For example, after:
@@ -603,11 +602,7 @@ def visit_for_stmt(self, o: ForStmt) -> None:
603
602
self .add_attribute_dependency_for_expr (o .expr , "__iter__" )
604
603
self .add_attribute_dependency_for_expr (o .expr , "__getitem__" )
605
604
if o .inferred_iterator_type :
606
- if self .python2 :
607
- method = "next"
608
- else :
609
- method = "__next__"
610
- self .add_attribute_dependency (o .inferred_iterator_type , method )
605
+ self .add_attribute_dependency (o .inferred_iterator_type , "__next__" )
611
606
else :
612
607
self .add_attribute_dependency_for_expr (o .expr , "__aiter__" )
613
608
if o .inferred_iterator_type :
@@ -803,9 +798,6 @@ def visit_comparison_expr(self, e: ComparisonExpr) -> None:
803
798
left = e .operands [i ]
804
799
right = e .operands [i + 1 ]
805
800
self .process_binary_op (op , left , right )
806
- if self .python2 and op in ("==" , "!=" , "<" , "<=" , ">" , ">=" ):
807
- self .add_operator_method_dependency (left , "__cmp__" )
808
- self .add_operator_method_dependency (right , "__cmp__" )
809
801
810
802
def process_binary_op (self , op : str , left : Expression , right : Expression ) -> None :
811
803
method = op_methods .get (op )
0 commit comments