Steve Holden <[EMAIL PROTECTED]> writes:
> Perfectly all right: you make the point very well that the behavior is
> an implementation artifact and not a language feature.
And for those who may be thinking "oh, so I can at least depend on the
behaviour within a particular implementation", that's
Duncan Booth wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>
>
>>Absolutely correct. It would be more interesting to discuss how the
>>output from these statements varied between (say) CPython, Jython and
>>Iron Python. At the moment the discussion is indeed about insignificant
>>implementa
Steve Holden <[EMAIL PROTECTED]> wrote:
> Absolutely correct. It would be more interesting to discuss how the
> output from these statements varied between (say) CPython, Jython and
> Iron Python. At the moment the discussion is indeed about insignificant
> implementation trivia.
CPython seems
Ben Finney wrote:
> "Fijoy George" <[EMAIL PROTECTED]> writes:
>
>
>>I am a bit perplexed by the following behaviour of the 'is' comparator
>
>
> In summary: you are seeing implementation details that the language
> specification explicitly allows to vary by implementation.
>
>
>>My understan
"Fijoy George" <[EMAIL PROTECTED]> writes:
> I am a bit perplexed by the following behaviour of the 'is' comparator
In summary: you are seeing implementation details that the language
specification explicitly allows to vary by implementation.
> My understanding was that every literal is a constr
Ben C wrote:
> I'm as baffled as you, even more so its implication:
There is no implication whatsoever. Whether immutable objects are
recycled by the compiler or not is totally implementation dependent, and
an irrelevant implementation detail. Since they can't be mutated,
whether their ident
Ben C wrote:
> On 2006-09-21, Fijoy George <[EMAIL PROTECTED]> wrote:
> > But my understanding does not explain the result of the second comparison.
> > According to the experiment, y[0] and y[1] are the same object!
>
> I'm as baffled as you, even more so its implication:
> >>> a = 2.
> >>> b =
On 2006-09-21, Fijoy George <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am a bit perplexed by the following behaviour of the 'is' comparator
>
x = 2.
x is 2.
> False
y = [2., 2.]
y[0] is y[1]
> True
>
> My understanding was that every literal is a constructure of an object.
> Th
"Fijoy George" <[EMAIL PROTECTED]> wrote:
> My understanding was that every literal is a constructure of an
> object. Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are
> different objects. Therefore, the comparison yields false.
What gave you that idea? The compiler may or may not fold tog
Hi all,
I am a bit perplexed by the following behaviour of the 'is' comparator
>>> x = 2.
>>> x is 2.
False
>>> y = [2., 2.]
>>> y[0] is y[1]
True
My understanding was that every literal is a constructure of an object.
Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are different objects.
10 matches
Mail list logo