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-June/025654.html below:

PEP 292, Simpler String Substitutions

[Python-Dev] Re: PEP 292, Simpler String SubstitutionsGuido van Rossum guido@python.org
Wed, 19 Jun 2002 22:50:51 -0400
> The distinction between %()s and %()r, recently introduced, has been
> useful.  But with str() and repr(), only one of those is really
> necessary.  But it gave the impression that Python trend is pushing
> for % to get stronger.  The proposal of using $ as yet another
> formatting avenue makes it weaker.

Language evolution doesn't always go into a straight line.

> > Less clutter.  Compare
> 
> >     "My name is $name, I live in $country"
> 
> > to
> 
> >     "My name is ${name}, I live in ${country}"
> 
> > The {} add nothing but noise.  We're copying this from the shell.
> 
> Noise decreases legibility.  So, maybe the PEP should not say that
> ${name} is to be preferred over $name?  Or else, it should explain
> why.

I agree that I see no reason to prefer ${name} (except when followed
by another word character of course).

--Guido van Rossum (home page: http://www.python.org/~guido/)




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