Explanation of list reference

Alan Bawden alan at scooby-doo.csail.mit.edu
Sun Feb 16 03:38:55 EST 2014


Marko Rauhamaa <marko at pacujo.net> writes:

> Case in point, if everything is a reference, how come:
>
>    >>> "hello".__str__()
>    'hello'
>    >>> 1.__str__()
>    SyntaxError: invalid syntax

   >>> (1).__str__()
   '1'

   >>> 1..__str__()
   '1.0'

-- 
Alan Bawden



More information about the Python-list mailing list