[Python-ideas] Re: Idea: Tagged strings in python

2022-12-18 Thread emil
dn wrote: > > Is this a problem with Python, or with the tool? > « > Language injections > Last modified: 14 December 2022 > Language injections let you work with pieces of code in other languages > embedded in your code. When you inject a language (such as HTML, CSS, > XML, RegExp, and so on) i

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread Emil Stenström
On Sat, Dec 17, 2022, at 19:20, Bruce Leban wrote: > > On Sat, Dec 17, 2022 at 10:10 AM wrote: >> I replied to this in a separate post, but html() is likely a function name >> that is used in millions of existing code bases. Applying this rule to all >> of them will lead to too many errors to b

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread emil
For reference: This thread has a much deeper discussion of this idea: https://discuss.python.org/t/allow-for-arbitrary-string-prefix-of-strings/19740/11 I'll continue the discussion there instead. ___ Python-ideas mailing list -- python-ideas@python.org

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread emil
Bruce Leban wrote: > > Try googling "python-ideas string prefixes". Doing mimimal diligence is a > > reasonable expectation before writing up an idea. Thanks for the query "string prefixes". I tried other queries but not that one. I ended my first message with "I hope I didn't break any unspoken

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread emil
David Mertz, Ph.D. wrote: > My impression whenever this idea is proposed is like Barry's. The "win" > isn't big enough not simply to use named functions. Named functions solve another problem, so I don't see how this is an alternative? More on this below. > Balancing out the slight "win" is the

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread emil
required down the line, but let's see if this is a good idea first? > If the tags are called as functions then you can do it today with this: > def html(s): > return s > HEAD = html('') If I'm not missing anything, this doesn't help with syntax highlighti

[Python-ideas] Idea: Tagged strings in python

2022-12-17 Thread emil
is? Do you see a value in adding tagged strings to python? Are there other use-cases where this would be useful? Does the suggestion need to support calling tags as functions like in javascript to be interesting? (I'm new to python-ideas, so I hope I haven't broken some unspoken rule with