Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Ben Rudiak-Gould
> On 3/31/18 5:43 PM, Steven D'Aprano wrote: > > But we could avoid that runtime cost if the keyhole optimizer performed > > the dedent at compile time: > > > > triple-quoted string literal > > .dedent() > > > > could be optimized at compile-time, like other constant-folding. There are a

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Christopher Barker
not that anyone asked, but I"d only support: > 2a) Adding a str.dedent() method and maybe: > 2b) Creating a constant-folding peephole optimization for methods on immutable literals and frankly, it's a much lighter lift to get approval than: 1) Creating a new type of string literal which compil

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Chris Angelico
On Sat, Feb 9, 2019 at 6:08 AM Mike Miller wrote: > > Thanks all, > > I'm willing to start work on a PEP, perhaps next week. Unless Marius would > prefer to do it. > > One fly in the ointment is that I don't feel strongly about the choice of > solution 1, 2, or last-minute entry. > That's not a

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Mike Miller
Thanks all, I'm willing to start work on a PEP, perhaps next week. Unless Marius would prefer to do it. One fly in the ointment is that I don't feel strongly about the choice of solution 1, 2, or last-minute entry. -Mike ___ Python-ideas mailing

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Chris Angelico
On Sat, Feb 9, 2019 at 3:19 AM Paul Moore wrote: > > On Thu, 7 Feb 2019 at 18:21, Mike Miller wrote: > > Anyone still interested in this? > > It feels like a nice idea to me, when reading the proposals. However, > in all of the code I've ever written in Python (and that's quite a > lot...) I've n

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Paul Moore
On Thu, 7 Feb 2019 at 18:21, Mike Miller wrote: > Anyone still interested in this? It feels like a nice idea to me, when reading the proposals. However, in all of the code I've ever written in Python (and that's quite a lot...) I've never actually had a case where I this feature would have made a

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Joao S. O. Bueno
/me also would be strongly in favor of this. "+1 " . Even taking in consideration the added complexity . On Fri, 8 Feb 2019 at 13:26, Paul Ferrell wrote: > I particularly like the str.dedent() idea. Adding yet another string > prefix adds more complexity to the language, which I'm generally not

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Paul Ferrell
I particularly like the str.dedent() idea. Adding yet another string prefix adds more complexity to the language, which I'm generally not in favor of. On 2/7/19, Mike Miller wrote: > Was: "Dart (Swift) like multi line strings indentation" > > This discussion petered-out but I liked the idea, as i

Re: [Python-ideas] Multi-line string indentation

2019-02-08 Thread Steven D'Aprano
On Thu, Feb 07, 2019 at 10:13:29AM -0800, Mike Miller wrote: > Was: "Dart (Swift) like multi line strings indentation" [...] > Anyone still interested in this? I am, but it will surely need a PEP. I'm not interested enough to write the PEP itself but I'm more than happy to tear it to bits^W^W^W e

Re: [Python-ideas] Multi-line string indentation

2019-02-07 Thread Mike Miller
Was: "Dart (Swift) like multi line strings indentation" This discussion petered-out but I liked the idea, as it alleviates something occasionally annoying. Am supportive of the d'' prefix, perhaps the capital prefixes can be deprecated to avoid issues? If not, a sometimes-optimized (or C-acc