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

Wes Turner wes.turner at gmail.com
Tue Aug 11 17:19:48 CEST 2015


On Aug 11, 2015 10:10 AM, "Alexander Walters" <tritium-list at sdamon.com>
wrote:
>
> This may seam like a simplistic solution to i18n, but why not just add a
method to string objects (assuming we implement f-strings) that just
returns the original, unprocessed string.  If the string was not an
f-string, it just returns self.  The gettext module can be modified, I
think trivially, to use the method instead of the string directly.
>
> Is this a horrible idea?

This is a backward compatible macro to elide code in strings that should
not be.

* IIUC, this would only be usable in 3.6+ (so, not at all and style guide
says NO)
  * there should be a normal functional() way to accomplish this in a
backwards compatible way
  * formatlng() / lookup() would be more future compatible

>
> - Alex W.
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
https://mail.python.org/mailman/options/python-dev/wes.turner%40gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150811/a8411f1a/attachment.html>


More information about the Python-Dev mailing list