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/2003-October/039459.html below:

[Python-Dev] Can we please have a better dict interpolation syntax?

[Python-Dev] Can we please have a better dict interpolation syntax? [Python-Dev] Can we please have a better dict interpolation syntax?Oren Tirosh oren-py-d at hishome.net
Fri Oct 24 14:48:50 EDT 2003
On Thu, Oct 23, 2003 at 02:36:41PM +1300, Greg Ewing wrote:
> I have just had the experience of writing a bunch
> of expressions of the form
> 
>   "create index %(table)s_lid1_idx on %(table)s(%(lid1)s)" % params
> 
> and found myself getting quite confused by all the parentheses
> and "s" suffixes. I would *really* like to be able to write
> this as
> 
>   "create index %{table}_lid1_idx on %{table}(%{lid1})" % params
> 
> which I find to be much easier on the eyes.

A while ago I proposed the following syntax for embedded expressions in 
strings, parsed at compile-time:
     "create index \{table}_lid1_idx on \{table}(\{lid1})"

And the equivalent runtime parsed version:
    r"create index \{table}_lid1_idx on \{table}(\{lid1})".cook(params)


testing-the-water-to-see-if-it's-PEP-time-ly yours,

   Oren


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