On Fri, Feb 21, 2020 at 04:26:01AM -0000, [email protected] wrote:
> The idea is to add a new string prefix 's' for SQL string. This string
> doesn't do anything in Python
That ought to rule it out then. Why are we adding syntax to the language
that doesn't get used anywhere in the language? All that means is one
more thing to confuse the reader:
Q: What's the difference between s'Hello world' and 'Hello world'?
A: Nothing.
one more thing for beginners to learn, one more feature for the
interpreter to support, and for no benefit to the language.
It's not like adding a new operator or syntactic form like the @
operator or extended slicing, both of which were added for the sake of
numpy. Once added to the language, *anyone* could use them in their own
code. Whereas this s-string would add no new functionality for people to
use, prevent the language ever using an s-prefix for something useful,
and give benefit only to users of particular enhanced interactive
environments.
And what's so special about SQL over, say, regular expressions, XML,
JSON, YAML, Markdown, ReST, LaTeX, etc? I might want to use the s''
prefix for embedded Scheme code rather than SQL.
> interactive Python shells like IPython or Jupyter can parse the
> following characters as SQL syntax instead of Python syntax and give
> SQL syntax highlighting and autocompletion
They can do that right now, if they desire. SQL syntax is distinctive
enough that if IPython wants to highlight SQL syntax, without any
changes to the language or the string, it could do so.
Besides, IPython already adds magic to their command line. If they
wanted to add more magic in the form of s-strings, we can't stop them.
--
Steven
_______________________________________________
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/S64WAIGS77NYNUXAOYHWDX6Q37L7SBQ7/
Code of Conduct: http://python.org/psf/codeofconduct/