Dick Moores wrote: > On 8/12/07, *Ben Finney* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Dick Moores <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> writes: > > > At 06:13 PM 8/9/2007, Ben Finney wrote: > > >it's entirely left to the language implementation which > > >optimisation trade-offs to make, and the language user (that's you > > >and I) should *not* expect any particular behaviour to hold between > > >different implementations. > > > > I'm not clear on the meaning of "implementations" here. Would 2.5 > > for Windows, Mac, Linux all be different implementations? Would Iron > > Python be another? ActivePython? > > For the purpose of the above statement, you should consider even the > same Python on two different machines to be "different > implementations". As a programmer writing Python code, you should not > expect any "implementation-dependent" behaviour to operate in any > particular way. > > > So would a programmer EVER use "is" in a script?
Sure. For example, the canonical test for None uses x is None because there is only ever one instance of type Nonetype, so it's the fastest test. Generally speaking you use "is" to test for identity (do these two expressions reference the same object) rather than equality (do these two expressions evaluate to equivalent objects). regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden --------------- Asciimercial ------------------ Get on the web: Blog, lens and tag the Internet Many services currently offer free registration ----------- Thank You for Reading ------------- -- http://mail.python.org/mailman/listinfo/python-list