is there a difference between one line and many lines

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Apr 21 20:25:56 EDT 2011


On 2011年4月21日 14:35:25 +0200, Peter Otten wrote:
> Steven D'Aprano wrote:
>>> but:
>>>>>>> a = 1001; b = 10001; a is b
>> False
>> I would hope so ;)

Doh!
>> The point is that Python is free to re-use immutable objects, or not
>> re- use them, as it sees fit.
>> Indeed, and I even found a Python implementation on my harddisk that
> does what you intended to show:
>> $ ipy
> IronPython 1.1.1 (1.1.1) on .NET 2.0.50727.1433 Copyright (c) Microsoft
> Corporation. All rights reserved.
>>>> a = 1001; b = 1001; a is b
> False

Much better, thank you :)
-- 
Steven


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /