A RetroSearch Logo

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

Search Query:

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

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

[Python-Dev] transitioning from % to {} formattingNick Coghlan ncoghlan at gmail.com
Thu Oct 1 23:15:14 CEST 2009
Glenn Linderman wrote:
> 1) Both the format message and all the parameters are supplied in a
> single API call.  This is really a foolish API, because
> 
>    def API( fmt, p1, p2, p3 ):
>     str = fmt % (p1, p2, p3)
> 
> could have just as easily been documented originally as
> 
>    def API( str ):
> 
> where the user is welcome to supply a string such as
> 
>    API( fmt % (p1, p2, p3 ))
> 
> and if done this way, the conversion to .format is obvious... and all
> under the users control.

The lazy APIs actually make a lot of sense, particularly when there is a
chance that the function being called may be able to avoid the
formatting call altogether.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
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