osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Explanation of list reference


Chris Angelico <rosuav at gmail.com>:

> On Sat, Feb 15, 2014 at 8:43 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Unfortunately neither the "everything is a reference" model nor the
>> "small/big" model help you predict the value of an "is" operator in
>> the ambiguous cases.
>
> Can you give an example of an ambiguous case?

The "x is y" test may yield different outcomes in different, valid
Python implementations:

   4 is 4
   (x,) is (x,)
   "hello" is "hello"


Marko