[Python-ideas] Custom string prefixes

Yuval Greenfield ubershmekel at gmail.com
Mon May 27 14:28:44 CEST 2013


On Mon, May 27, 2013 at 1:41 PM, Göktuğ Kayaalp <goktug.kayaalp at gmail.com>wrote:

> I think it would add some significant flexibility to Python to let users
> define custom string prefixes. What I mean by a string prefix is,
> a letter prefixing the string literal, modifying the behavior of it,
> [...]
>

The feature isn't present. But it isn't really clear what you want either.
The current string prefixes are not dynamically analyzed. Do you want
static hooks for the lexer? A string method to register new prefixes? Do
you want to specify new string prefixes in the existing framework?

I think string prefixes aren't something that we want more of, this is
already complicated enough:
"b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
"r" | "u" | "R" | "U"

We should be more creative on how to get rid of them.

Yuval Greenfield
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130527/e7a85920/attachment.html>


More information about the Python-ideas mailing list