A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-October/093067.html below:

[Python-Dev] transitioning from % to {} formatting

[Python-Dev] transitioning from % to {} formatting [Python-Dev] transitioning from % to {} formattingLie Ryan lie.1296 at gmail.com
Sun Oct 18 06:11:16 CEST 2009
Michael Foord wrote:
> Benjamin Peterson wrote:
>> 2009/10/5 Nick Coghlan <ncoghlan at 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>

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4