[Python-ideas] Re: An alternate idea for escaping in string interpolation

2021-06-27 Thread Paul Bryan
It looks like you're suggesting hard-coding specific language escape conventions into f-strings? What if instead you were to allow delegation to some filter function? Then, it's generic and extensible. def html(value: Any):     filtered = ... # filter here     return filtered f'{!!html}...' P

[Python-ideas] Re: An alternate idea for escaping in string interpolation

2021-06-27 Thread Paul Moore
On Sun, 27 Jun 2021 at 08:11, Paul Bryan wrote: > > It looks like you're suggesting hard-coding specific language escape > conventions into f-strings? That's how I understood the proposal too. Hard coding specific conventions shouldn't be part of a language construct IMO. > What if instead you

[Python-ideas] joining paths without worrying about a leading slash

2021-06-27 Thread Zbigniew Jędrzejewski-Szmek
[this is a continuation of https://bugs.python.org/issue44452] pathlib.Path() has a concatenation operator "/" that allows the right-hand-side argument to be an absolute path, which causes the left-hand-side argument to be ignored: >>> pathlib.Path('/foo') / '/bar' PosixPath('/bar') >>> pathlib.P

[Python-ideas] Re: joining paths without worrying about a leading slash

2021-06-27 Thread Barry Scott
> On 27 Jun 2021, at 12:07, Zbigniew Jędrzejewski-Szmek > wrote: > > [this is a continuation of https://bugs.python.org/issue44452] > > pathlib.Path() has a concatenation operator "/" that allows the > right-hand-side argument to be an absolute path, which causes the > left-hand-side argument

[Python-ideas] Re: An alternate idea for escaping in string interpolation

2021-06-27 Thread Bruce Leban
Thanks for the comments, Paul and Paul. On Sun, Jun 27, 2021 at 1:14 AM Paul Moore wrote: > On Sun, 27 Jun 2021 at 08:11, Paul Bryan wrote: > > > > It looks like you're suggesting hard-coding specific language escape > conventions into f-strings? > > That's how I understood the proposal too. Ha

[Python-ideas] Re: joining paths without worrying about a leading slash

2021-06-27 Thread Wes Turner
"[Python-ideas] Sanitize filename (path part) 2nd try" https://mail.python.org/archives/list/[email protected]/thread/LRIKMG3G4I4YQNK6BTU7MICHT7X67MEF/ "[Python-ideas] Sanitize filename (path part)" https://mail.python.org/archives/list/[email protected]/thread/SQH4LPERFLKBLXPDUOVJMV24