[Python-ideas] Idea: Tagged strings in python

2022-12-17 Thread emil
Hi everyone! I'm the maintainer of a small django library called django-components. I've run into a problem that I have a language-level solution (tagged strings) to, that I think would benefit the wider python community. *Problem* A component in my library is a combination of python code, html

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

2022-12-17 Thread Barry Scott
> On 17 Dec 2022, at 16:07, e...@emilstenstrom.se wrote: > > Hi everyone! > > I'm the maintainer of a small django library called django-components. I've > run into a problem that I have a language-level solution (tagged strings) to, > that I think would benefit the wider python community. >

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

2022-12-17 Thread David Mertz, Ph.D.
My impression whenever this idea is proposed is like Barry's. The "win" isn't big enough not simply to use named functions. Balancing out the slight "win" is the much larger loss of adding additional complexity to the Python language. New grammar, new parser, possibly new semantics if tagged stri

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

2022-12-17 Thread emil
Hi Barry, Your reply could easily be read as "this is a bad idea, and you shouldn't have bothered writing it down". I hope that was not your intention, and instead it comes from handling self-indulgent people expecting things from you all day. I know, I get those requests too. I'll assume that

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

2022-12-17 Thread Bruce Leban
On Sat, Dec 17, 2022 at 9:43 AM wrote: > > Your reply could easily be read as "this is a bad idea, and you shouldn't > have bothered writing it down". I hope that was not your intention, and > instead it comes from handling self-indulgent people expecting things from > you all day. I know, I get

[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
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
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 Bruce Leban
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 be acceptable to editors I think. > And if this has to be e

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

2022-12-17 Thread C. Titus Brown via Python-ideas
> On Dec 17, 2022, at 10:08 AM, e...@emilstenstrom.se wrote: > > 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

[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 David Mertz, Ph.D.
On Sat, Dec 17, 2022, 1:03 PM wrote: > > Moreover, there is no reason an editor could not have a capability to > > "colorize any string passed to a function named foo()." Perhaps with > some > > sort of configuration file that indicates which function names correspond > > to which languages, but

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

2022-12-17 Thread Eric V. Smith via Python-ideas
Jim Baker has been working on tagged strings, and Guido has a working implementation. See https://github.com/jimbaker/tagstr/issues/1 I thought Jim had a draft PEP on this somewhere, but I can’t find it. -- Eric > On Dec 17, 2022, at 11:14 AM, e...@emilstenstrom.se wrote: > > Hi everyone! >

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

2022-12-17 Thread David Mertz, Ph.D.
Just to be clear on my opinion. I think Emil's idea was 100% appropriate to share on python-ideas, and he does a good job of showing where it works be useful. Sure, a background search is nice, but not required. That doesn't mean I *support* the idea. I take a very conservative attitude towards la

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

2022-12-17 Thread dn
On 18/12/2022 05.07, e...@emilstenstrom.se wrote: I'm the maintainer of a small django library called django-components. I've run into a problem that I have a language-level solution (tagged strings) to, that I think would benefit the wider python community. *Problem* ... Seems simple enoug