Explanation of list reference

Marko Rauhamaa marko at pacujo.net
Sat Feb 15 04:10:46 EST 2014


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



More information about the Python-list mailing list