Jython class names

Erik Max Francis max at alcyone.com
Tue Sep 9 15:18:26 EDT 2003


Michael Chermside wrote:

> Simple rule. ALWAYS use "==" for comparing strings, NEVER use "is".
> The
> only exception is if you are working on the internals of the string
> class, or perhaps writing some subclass of string with wierd behavior.
> The behavior of "is" is undefined for all immutable built-in types --
> not "undefined behavior" in the sense of the C standard (computer may
> grow legs and wander out of the room if you do this), but "undefined"
> in the sense that comparing two integers or two strings with "is" MAY
> return True, or it may return False, and no promises are made as to
> which way it will go.

The usual Standard terminology for this is "unspecified"; as you point
out, "undefined" means nasal demons.  There's also a third possibility,
"implementation defined," which is the same as unspecified except the
implementation must document its choice of behaviors.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Silence is the most perfect expression of scorn.
\__/  George Bernard Shaw




More information about the Python-list mailing list