Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I presumed that == would already include the optimization len(a) != len(b), do you know how that equality check is implemented and where I could view the source? Commented Jul 14, 2012 at 8:17
  • 1
    i is j works only for small numbers, and the meaning of "small" is implementation dependent. See: stackoverflow.com/questions/11476190/why-0-6-is-6-false Commented Jul 14, 2012 at 9:30
  • 1
    Why would you reimplement a == b? And your examples for numbers is wrong, as @slothrop points out. Commented Jul 14, 2012 at 11:31
  • "There should be one-- and preferably only one --obvious way to do it. ". And "==" is the obvious way to do it. Don't confuse people. Commented Dec 11, 2017 at 10:05