potiuk commented on a change in pull request #6601: [AIRFLOW-6010] Remove 
cyclic imports and pylint disables
URL: https://github.com/apache/airflow/pull/6601#discussion_r348554243
 
 

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -433,8 +431,7 @@ def __init__(
             self._outlets.update(outlets)
 
     def __eq__(self, other):
-        if (type(self) == type(other) and  # pylint: 
disable=unidiomatic-typecheck
-                self.task_id == other.task_id):
+        if type(self) is type(other) and self.task_id == other.task_id:
 
 Review comment:
   In case of type() objects it's a bit faster and works the same way. Types 
are always singletons   so == is equivalent to "is". It's - I think - common 
practice and it is an explicit way of comparing "exact" types rather than using 
isinstance. At least pylint does not complain any more with "suspicious type 
comparision". 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to