What does the 'is' operator compare?
- A Object identity, whether both names refer to the same object
- B Value equality
- C Type only
- D String content
Answer
Object identity, whether both names refer to the same object
Use == for value comparison and 'is' only for singletons such as None. Small integer and string caching can make 'is' appear to work by accident.





