What other languages use the same data model as Python?

Chris Angelico rosuav at gmail.com
Thu May 5 07:48:20 EDT 2011


On Thu, May 5, 2011 at 9:44 PM, Mel <mwilson at the-wire.com> wrote:
> John Nagle wrote:
>> On 5/4/2011 5:46 PM, harrismh777 wrote:
>>> Or, as stated earlier, Python should not allow 'is' on immutable objects.
>>
>>     A reasonable compromise would be that "is" is treated as "==" on
>> immutable objects.
>
> I foresee trouble testing among float(5), int(5), Decimal(5) ...

Define 'x is y' as 'type(x)==type(y) and
isinstance(x,(int,float,tuple,etc,etc,etc)) and x==y' then.

Chris Angelico



More information about the Python-list mailing list