Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Paul Moore
On 17 August 2015 at 05:34, Victor Stinner victor.stin...@gmail.com wrote: 2015-08-16 7:21 GMT-07:00 Paul Moore p.f.mo...@gmail.com: 2. By far and away the most common use for me would be things like print(fIteration {n}: Took {end-start) seconds). At the moment I use str,format() for this,

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Larry Hastings
On 08/17/2015 03:02 AM, Paul Moore wrote: On 17 August 2015 at 05:34, Victor Stinner victor.stin...@gmail.com wrote: 2015-08-16 7:21 GMT-07:00 Paul Moore p.f.mo...@gmail.com: 3. All of the complex examples look scary, but in practice I wouldn't write stuff like that - why would anyone do so

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Paul Moore
On 17 August 2015 at 12:48, Larry Hastings la...@hastings.org wrote: I think this corner of the debate is covered by the Consenting adults guiding principle we use 'round these parts. Precisely. Paul ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Burning down the backlog.

2015-08-17 Thread Nathaniel Smith
On Mon, Aug 17, 2015 at 7:37 PM, Robert Collins robe...@robertcollins.net wrote: On 26 July 2015 at 07:28, Robert Collins robe...@robertcollins.net wrote: For my part, I'm going to pick up more or less one thing a day and review it, but I think it would be great if other committers were to

Re: [Python-Dev] Burning down the backlog.

2015-08-17 Thread Ben Finney
Robert Collins robe...@robertcollins.net writes: However - 9 isn't a bad number for 'patches that the triagers think are ready to commit' inventory. So yay!. Also - triagers, thank you for feeding patches through the process. Please keep it up :) If I were a cheerleader I would be able to

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Stephen J. Turnbull
Barry Warsaw writes: On Aug 17, 2015, at 11:02 AM, Paul Moore wrote: print(fIteration {n}: Took {end-start) seconds) This illustrates (more) problems I have with arbitrary expressions. First, you've actually made a typo there; it should be {end-start} -- notice the trailing

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Steve Dower
On 17Aug2015 0813, Barry Warsaw wrote: On Aug 18, 2015, at 12:58 AM, Chris Angelico wrote: The linters could tell you that you have no 'end' or 'start' just as easily when it's in that form as when it's written out in full. Certainly the mismatched brackets could easily be caught by any sort

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Steve Dower
On 17Aug2015 1506, Steve Dower wrote: On 17Aug2015 0813, Barry Warsaw wrote: On Aug 18, 2015, at 12:58 AM, Chris Angelico wrote: The linters could tell you that you have no 'end' or 'start' just as easily when it's in that form as when it's written out in full. Certainly the mismatched

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Wes Turner
On Aug 17, 2015 2:23 PM, Nikolaus Rath nikol...@rath.org wrote: On Aug 16 2015, Paul Moore p.f.mo...@gmail.com wrote: 2. By far and away the most common use for me would be things like print(fIteration {n}: Took {end-start) seconds). I believe an even more common use willl be

Re: [Python-Dev] Burning down the backlog.

2015-08-17 Thread Robert Collins
On 26 July 2015 at 07:28, Robert Collins robe...@robertcollins.net wrote: On 21 July 2015 at 19:40, Nick Coghlan ncogh...@gmail.com wrote: All of this is why the chart that I believe should be worrying people is the topmost one on this page: http://bugs.python.org/issue?@template=stats Both

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread MRAB
On 2015-08-17 23:06, Steve Dower wrote: On 17Aug2015 0813, Barry Warsaw wrote: On Aug 18, 2015, at 12:58 AM, Chris Angelico wrote: The linters could tell you that you have no 'end' or 'start' just as easily when it's in that form as when it's written out in full. Certainly the mismatched

Re: [Python-Dev] [Datetime-SIG] PEP 495 (Local Time Disambiguation) is ready for pronouncement

2015-08-17 Thread Alexander Belopolsky
[Posted on Python-Dev] On Sun, Aug 16, 2015 at 3:23 PM, Guido van Rossum gu...@python.org wrote: I think that a courtesy message to python-dev is appropriate, with a link to the PEP and an invitation to discuss its merits on datetime-sig. Per Gudo's advise, this is an invitation to join PEP

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Barry Warsaw
On Aug 17, 2015, at 11:02 AM, Paul Moore wrote: print(fIteration {n}: Took {end-start) seconds) This illustrates (more) problems I have with arbitrary expressions. First, you've actually made a typo there; it should be {end-start} -- notice the trailing curly brace. Second, what if you

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Eric V. Smith
On 08/16/2015 03:37 PM, Guido van Rossum wrote: On Sun, Aug 16, 2015 at 8:55 PM, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com wrote: Thanks, Paul. Good feedback. Indeed, I smiled when I saw Paul's post. Triple quoted and raw strings work like you'd expect, but

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Barry Warsaw
On Aug 18, 2015, at 12:58 AM, Chris Angelico wrote: The linters could tell you that you have no 'end' or 'start' just as easily when it's in that form as when it's written out in full. Certainly the mismatched brackets could easily be caught by any sort of syntax highlighter. The rules for

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Chris Angelico
On Tue, Aug 18, 2015 at 12:50 AM, Barry Warsaw ba...@python.org wrote: On Aug 17, 2015, at 11:02 AM, Paul Moore wrote: print(fIteration {n}: Took {end-start) seconds) This illustrates (more) problems I have with arbitrary expressions. First, you've actually made a typo there; it should

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Guido van Rossum
On Mon, Aug 17, 2015 at 7:13 AM, Eric V. Smith e...@trueblade.com wrote: [...] My current plan is to replace an f-string with a call to .format_map: foo = 100 bar = 20 f'foo: {foo} bar: { bar+1}' Would become: 'foo: {foo} bar: { bar+1}'.format_map({'foo': 100, ' bar+1': 21}) The

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Guido van Rossum
On Mon, Aug 17, 2015 at 8:13 AM, Barry Warsaw ba...@python.org wrote: I'm really asking whether it's technically feasible and realistically possible for them to do so. I'd love to hear from the maintainers of pyflakes, pylint, Emacs, vim, and other editors, linters, and other static

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Nikolaus Rath
On Aug 16 2015, Paul Moore p.f.mo...@gmail.com wrote: 2. By far and away the most common use for me would be things like print(fIteration {n}: Took {end-start) seconds). I believe an even more common use willl be print(fIteration {n+1}: Took {end-start} seconds) Note that not allowing

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Guido van Rossum
On Mon, Aug 17, 2015 at 12:23 PM, Nikolaus Rath nikol...@rath.org wrote: On Aug 16 2015, Paul Moore p.f.mo...@gmail.com wrote: 2. By far and away the most common use for me would be things like print(fIteration {n}: Took {end-start) seconds). I believe an even more common use willl be

Re: [Python-Dev] PEP-498 PEP-501: Literal String Formatting/Interpolation

2015-08-17 Thread Peter Ludemann via Python-Dev
How is this proposal of di... more than a different spelling of lambda i...? (I think it's a great idea — but am wondering if there are some extra semantics that I missed) I don't think there's any need to preserve the values of the {...} (or ${...}) constituents — the normal closure mechanism

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Eric V. Smith
On 8/17/2015 2:24 PM, Guido van Rossum wrote: On Mon, Aug 17, 2015 at 7:13 AM, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com wrote: [...] My current plan is to replace an f-string with a call to .format_map: foo = 100 bar = 20 f'foo: {foo} bar: {

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread Guido van Rossum
On Mon, Aug 17, 2015 at 1:26 PM, Eric V. Smith e...@trueblade.com wrote: [...] I think it would be possible to create a version of this that works for both i18n and regular interpolation. I think the open issues are: 1. Barry wants the substitutions to look like $identifier and possibly