append on lists

Maric Michaud maric at aristote.info
Tue Sep 16 10:10:49 EDT 2008


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, the specification of the language says that 
it should be false, 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 ;)

-- 
_____________

Maric Michaud



More information about the Python-list mailing list