append on lists
Grant Edwards
grante at visi.com
Tue Sep 16 10:57:26 EDT 2008
On 2008-09-16, Maric Michaud <maric at aristote.info> wrote:
> Le Tuesday 16 September 2008 15:57:53 Grant Edwards, vous avez écrit :
>> On 2008-09-16, Maric Michaud <maric at aristote.info> wrote:
>> > all expressions that return something, return a new object,
>>
>> That's not _quite_ true:
>> >>> a=1
>> >>> b=a.__add__(0)
>> >>> a is b
>>
>> True
>>
>> ;)
>
> This is implementation specific,
Indeed.
> the specification of the language says that it should be
> false,
That's curious. If so, then the implimentation is in violating
the specification. Where is that in the specification? I
suspect the statement in the specification should only apply to
mutable objects.
> and it is for higher numbers :
>
>>>>[15]: a=1000
>
>>>>[16]: b=a.__add__(0)
>
>>>>[17]: a is b
> ...[17]: False
>
> Don't disturb our OP, with side questions, please, it was
> enough hard like this ;)
I'm not trying to confuse the OP, but to quote Einstein:
"Everything should be made as simple as possible, but not
simpler."
--
Grant Edwards grante Yow! I wonder if I could
at ever get started in the
visi.com credit world?
More information about the Python-list
mailing list