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/2002-July/026688.html below:

why string substitution is not the same operation as data formatting

[Python-Dev] PEP 292-related: why string substitution is not the same operation as data formattingLalo Martins lalo@laranja.org
Thu, 18 Jul 2002 12:03:40 -0300
On Fri, Jul 12, 2002 at 10:47:34AM -0400, Guido van Rossum wrote:
> > Guido, can you please, for our enlightenment, tell us what are the
> > reasons you feel %(foo)s was a mistake?
> 
> Because of the trailing 's'.  It's very easy to leave it out by
> mistake, and because the definition of printf formats skips over
> spaces (don't ask me why), the first character of the following word
> is used as the type indicator.

In case that wasn't clear, I agree with that - I asked because I wanted this
in writing for the record.

BTW: IIRC, it skips over spaces because spaces are a valid format modifier
(meaning "pad with spaces").

[]s,
                                               |alo
                                               +----
--
            Those who trade freedom for security
               lose both and deserve neither.
--
http://www.laranja.org/                mailto:lalo@laranja.org
         pgp key: http://www.laranja.org/pessoal/pgp

Eu jogo RPG! (I play RPG)         http://www.eujogorpg.com.br/
Python Foundry Guide http://www.sf.net/foundry/python-foundry/




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