In javascript, there are strict comparison operators op1 === op2
and op1 !== op2
that will compare both type and value. Is there a pythonic way of
In python there is only one strict comparison operator that is ==
Suppose we have 2 cases:
>>> 2 == '2'
False
# Comparison of Int with string, it returns False
>>> 2 == 2.0
True
# Comparison of Int with Float, it returns True
However in other programming languages like Julia, There is a distinction between comparison operator and strict comparison operator.
>>> 2 == 2.0
true
>>> 2 === 2.0
false
# strict comparison operator, namely === which is true only if two values agree fully as to type as well as value.