why () is () and [] is [] work in other way?

John Nagle nagle at animats.com
Mon Apr 23 12:04:17 EDT 2012


On 4/22/2012 9:34 PM, Steven D'Aprano wrote:
> On Sun, 22 Apr 2012 12:43:36 -0700, John Nagle wrote:
>
>> On 4/20/2012 9:34 PM, john.tantalo at gmail.com wrote:
>>> On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote:
>>>
>>>> I believe it says somewhere in the Python docs that it's undefined and
>>>> implementation-dependent whether two identical expressions have the
>>>> same identity when the result of each is immutable
>>
>>      Bad design.  Where "is" is ill-defined, it should raise ValueError.
>
> "is" is never ill-defined. "is" always, without exception, returns True
> if the two operands are the same object, and False if they are not. This
> is literally the simplest operator in Python.
>
> John, you've been using Python for long enough that you should know this.
> I can only guess that you are trolling, although I can't imagine why.

    Because the language definition should not be what CPython does.
As PyPy advances, we need to move beyond that.

					John Nagle



More information about the Python-list mailing list