To understand the difference between ‘is’ and ‘==‘ may require some background in programming.
Specifically, “a==b” evaluates to “True” if the objects ‘a’ and ‘b’ “evaluate to the same *value*”, while “a is b” evaluates to “True” if the objects ‘a’ and ‘b’ *are the same” (i.e., are located at the same locations in RAM).
If that is not clear (and it need not be; it’s a kind of complicated issue in programming language design and implementation), do an internet search for something like “is vs == in python”.
To answer your questions, your impression is not correct (but you are not alone), and the code is not misleading (making the rash assumption that it is correct, which I have not verified).
HTH
Justin
--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's income
-----------
--
They said it couldn't be done, but sometimes,
it doesn't work out that way.
- Casey Stengel
--