> Don't say that this proposal won't be abused. Every one of the OP's
> motivating examples is an abuse of the syntax, returning non-strings
> from something that looks like a string.
If you strongly believe that if something looks like a string it ought to quack
like a string too, then we can consider 2 potential remedies:
1. Change the delimiter, for example use curly braces: `re{abc}`. This would
still be parseable, since currently an id cannot be followed by a set or a
dict. (The forward-slash, on the other hand, will be ambiguous).
2. We can also leave the quotation marks as delimiters. Once this feature is
implemented, the IDEs will update their parsers, and will be emitting a token
of "user-defined literal" type. Simply setting the color for this token to
something different than your preferred color for strings will make it visually
clear that those tokens aren't strings. Hence, no possibility for confusion.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/SSVHMHEJIPPUWNTRSR7IFKUHY4C23TWA/
Code of Conduct: http://python.org/psf/codeofconduct/