Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Chris Angelico writes: > On Wed, 7 Sept 2022 at 03:52, Meredith Montgomery > wrote: >> >> It seems to me that str.format is not completely made obsolete by the >> f-strings that appeared in Python 3.6. But I'm not thinking that this >> was the objective of the introduction of f-strings: the

Re: on str.format and f-strings

2022-09-06 Thread Chris Angelico
On Wed, 7 Sept 2022 at 03:52, Meredith Montgomery wrote: > > It seems to me that str.format is not completely made obsolete by the > f-strings that appeared in Python 3.6. But I'm not thinking that this > was the objective of the introduction of f-strings: the PEP at > >

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Julio Di Egidio writes: > On Tuesday, 6 September 2022 at 01:03:02 UTC+2, Meredith Montgomery wrote: >> Julio Di Egidio writes: >> > On Monday, 5 September 2022 at 22:18:58 UTC+2, Meredith Montgomery wrote: >> >> r...@zedat.fu-berlin.de (Stefan Ram) writes: >> > >> >> > , but with the

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Julio Di Egidio writes: > On Monday, 5 September 2022 at 22:18:58 UTC+2, Meredith Montgomery wrote: >> r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> > , but with the spaces removed, it's even one character >> > shorter than the format expression: >> > >> > eval('f"The name is {name} and

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: > ... >> d = { "name": "Meredith", "email": "mmontgom...@levado.to" } >> return "The name is {name} and the email is {email}".format(**d) >>--8<---cut here---end--->8--- >>Is there a

on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
It seems to me that str.format is not completely made obsolete by the f-strings that appeared in Python 3.6. But I'm not thinking that this was the objective of the introduction of f-strings: the PEP at https://peps.python.org/pep-0498/#id11 says so explicitly. My question is whether

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I suggest you discuss this on python-ideas, since we'll need to reach consensus there, first. -- components: +Interpreter Core -IO, Library (Lib) ___ Python tracker

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Charles Machalow
Charles Machalow added the comment: In terms of multiple parameters, I propose adding a method to control the defaults used by !p. Though the defaults would work more than well enough for basic log and print usage. -- ___ Python tracker

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Raymond that it's unlikely that this will work, as a practical matter. In addition to the other problems mentioned, there's the issue of the many parameters to control pprint. And I agree with pprint, or a replacement, needing a redesign. I

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Charles Machalow
Charles Machalow added the comment: One of the key things for ppformat here is to format long spanning dicts/lists to multiple lines, that look easy to read in a log. I feel as though that feature/usefulness outweigh potential indentation weirdness. A lot of the usage would probably be

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: If the python-ideas discussion is fruitful, go ahead and re-open this tracker item. Personally, I don't see how this would work. The pretty printing routines rely on knowing their current level of indentation. Also, much of the "prettiness" comes from

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-15 Thread Charles Machalow
Charles Machalow added the comment: Fair enough. Didn't really know that list existed. Sent this there. Awaiting moderator approval. Thanks. -- ___ Python tracker ___

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This needs discussion on python-ideas/ideas category on discourse similar to f-string debug notation. -- nosy: +eric.smith, xtreak ___ Python tracker

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-15 Thread Charles Machalow
ts: IO, Library (Lib) messages: 373738 nosy: Charles Machalow priority: normal severity: normal status: open title: add !p to pprint.pformat() in str.format() an f-strings type: enhancement versions: Python 3.10 ___ Python tracker <https://bug