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/2015-August/141211.html below:

[Python-Dev] PEP-498: Literal String Formatting

[Python-Dev] PEP-498: Literal String FormattingSteven D'Aprano steve at pearwood.info
Tue Aug 11 04:17:42 CEST 2015
On Mon, Aug 10, 2015 at 09:23:15PM +0200, Guido van Rossum wrote:

[...]
> Anyway, this generalization from print() is why I want arbitrary
> expressions. Wouldn't it be silly if we introduced print() today and said
> "we don't really like to encourage printing complicated expressions, but
> maybe we can introduce them in a future version"... :-)

That's a straw-man argument. Nobody is arguing against allowing 
arbitrary expressions as arguments to functions.

If you want a fair analogy, how about the reluctance to allow arbitrary 
expressions as decorators?

@[spam, eggs, cheese][switch]
def function():
    ...


As far as I can see, the non-straw argument is that f-strings be limited 
to the same subset of expressions that format() accepts: name and 
attribute look-ups, and indexing.



-- 
Steve
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