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

[Python-Dev] Binary Operator for New-Style String Formatting

[Python-Dev] Binary Operator for New-Style String Formatting [Python-Dev] Binary Operator for New-Style String FormattingAntoine Pitrou solipsis at pitrou.net
Sun Jun 21 20:45:20 CEST 2009
Hello,

> For better or for worse, I have created a patch against the py3k trunk
> which introduces a binary operator '@' as an alternative syntax for
> the new string formatting system introduced by PEP 3101 ("Advanced
> String Formatting"). [1]

While many people find the new format() tedious to adapt to, I don't think
adding a third formatting syntax will help us.

Especially given this annoyance:

> Lastly, to print the repr() of a dictionary as an unnamed argument,
> one would have to append an additional dictionary so there is no
> ambiguity:
> 
>     >>> "{}" @ {"foo": "bar"}
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     IndexError: tuple index out of range
> 
>     >>> "{}" @ ({"foo": "bar"}, {})
>     "{'foo': 'bar'}"

Regards

Antoine.


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