Michael Foord wrote:
Benjamin Peterson wrote:
2009/10/5 Nick Coghlan <ncogh...@gmail.com>:
So I would agree that method invocation on literals (particularly string
literals) is an already established language idiom.

And who hasn't ever used 4.56.as_integer_ratio()? :)
>
I've tried 4.__add__ a few times (not for a while now though).

That's a Syntax Error
>>> 4.__add__
  File "<stdin>", line 1
    4.__add__
            ^
SyntaxError: invalid syntax

however this works:
>>> 4 .__add__
<method-wrapper '__add__' of int object at 0x1E1FA028>

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to