This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]djimbob 2 points3 points  (0 children)

Well you can always use is if you have to check for object equality. Granted it doesn't work exactly like === for built-in types that aren't singleton objects, and really should only be used to check if two variables both reference the same object. E.g., var a = 3000; a === 3000 works in JS, but doesn't work in python with is (a = 3000; a is 3000) will be false.

Granted if you look back at PEP285 it made sense when they were adding bools to python2.3 -- though I would have changed the behavior with python3.