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

Robert Kern robert.kern at gmail.com
Mon Apr 23 15:28:29 EDT 2012


On 4/23/12 5:04 PM, John Nagle wrote:
> 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.

It isn't. That's the point of leaving some things like the interning of certain 
special objects undefined, to make room for other implementations. You seem to 
be objecting to that for some bizarre reason.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list