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

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

[Python-Dev] transitioning from % to {} formatting [Python-Dev] transitioning from % to {} formattingINADA Naoki songofacandy at gmail.com
Mon Oct 5 03:52:31 CEST 2009
What about using string prefix 'f'?

  f"{foo} and {bar}" % something == "{foo} and {bar}.format(something)

  s = f"{foo}"
  t = "%(bar)s"
  s + t  # raises Exception

Transition plan:
n: Just add F prefix. And adding "format_string" in future.
n+1: deprecate __mod__() without 'F'.
n+2: libraries use .format() and deprecate __mod__() with 'F'
n+3: remove __mod__()

-- 
Naoki INADA  <songofacandy at gmail.com>
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