Puzzled by "is"

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Aug 10 14:21:55 EDT 2007


On Fri, 10 Aug 2007 10:57:22 -0700, Dick Moores wrote:

> At 06:13 PM 8/9/2007, Ben Finney wrote:
>>Others have already said that it's an implementation optimisation,
>>which seems to partly answer your question.
>>
>>It's important to also realise that the language is *deliberately*
>>non-committal on whether any given value will have this behaviour;
>>that is, 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?

Taken to the extreme you shouldn't rely on implementation details at all,
so even the very same interpreter might cache and reuse the empty tuple in
one run but not in the next.

For me CPython, Iron Python and Jython are different implementations as
they are all written from scratch.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list