This question already has an answer here:
- Is there a difference between `==` and `is` in Python? 20 answers
- String comparison in Python: is vs. == [duplicate] 4 answers
I run the following in the Python interpreter:
>>> foo = 10
>>> dir(foo) == dir(10)
True
>>> dir(foo) is dir(10)
False
>>>
Why is this?