@@ -225,7 +225,6 @@ def __init__(
225225 ) -> None :
226226 self .scope = Scope ()
227227 self .type_map = type_map
228- self .python2 = python_version [0 ] == 2
229228 # This attribute holds a mapping from target to names of type aliases
230229 # it depends on. These need to be processed specially, since they are
231230 # only present in expanded form in symbol tables. For example, after:
@@ -603,11 +602,7 @@ def visit_for_stmt(self, o: ForStmt) -> None:
603602 self .add_attribute_dependency_for_expr (o .expr , "__iter__" )
604603 self .add_attribute_dependency_for_expr (o .expr , "__getitem__" )
605604 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__" )
611606 else :
612607 self .add_attribute_dependency_for_expr (o .expr , "__aiter__" )
613608 if o .inferred_iterator_type :
@@ -803,9 +798,6 @@ def visit_comparison_expr(self, e: ComparisonExpr) -> None:
803798 left = e .operands [i ]
804799 right = e .operands [i + 1 ]
805800 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__" )
809801
810802 def process_binary_op (self , op : str , left : Expression , right : Expression ) -> None :
811803 method = op_methods .get (op )
0 commit comments