Re: [Python-Dev] trailing commas on statements

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 3:01 AM, R. David Murray rdmur...@bitdance.com wrote: Sorry, trailing comma outside () was a shorthand for 'trailing comma on a complete statement'. That is, what trips me up is going from something like: dict(abc=1, foo=2, bar=3, )

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

2015-08-11 Thread Stefan Behnel
ISAAC J SCHWABACHER schrieb am 11.08.2015 um 01:05: I don't know about you, but I sure like this better than what you have: code.putlines(f static char {entry.doc_cname}[] = { split_string_literal(escape_bytestring(docstr))}; { # nested! f #if CYTHON_COMPILING_IN_CPYTHON struct

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Greg Ewing
Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs and other product failures in video form. While a phonetic play on the name YouTube, the abbreviation also colloquially means just what you

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

2015-08-11 Thread Stephen J. Turnbull
Barry Warsaw writes: Besides, any expression you have to calculate can go in a local that will get interpolated. Sure, but that style should be an application programmer choice. If this syntax can't replace the vast majority of cases where the format method is invoked on a literal string

[Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread Robert Collins
So, there's a patch on issue 9232 - allow trailing commas in function definitions - but there's been enough debate that I suspect we need a PEP. Would love it if someone could correct me, but I'd like to be able to either categorically say 'no' and close the ticket, or 'yes and this is what

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Cameron Simpson
On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs and other product failures in video form. While a phonetic play on the

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Steven D'Aprano
On Tue, Aug 11, 2015 at 09:51:56PM +1000, Chris Angelico wrote: On Tue, Aug 11, 2015 at 5:08 PM, Cameron Simpson c...@zip.com.au wrote: On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Chris Angelico
On Tue, Aug 11, 2015 at 5:08 PM, Cameron Simpson c...@zip.com.au wrote: On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread R. David Murray
On Tue, 11 Aug 2015 18:09:34 +1200, Robert Collins robe...@robertcollins.net wrote: So, there's a patch on issue 9232 - allow trailing commas in function definitions - but there's been enough debate that I suspect we need a PEP. Would love it if someone could correct me, but I'd like to be

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 12:46 AM, R. David Murray rdmur...@bitdance.com wrote: (If you wanted to fix an 'oops' trailing comma syntax issue, I'd vote for disallowing trailing commas outside of (). The number of times I've ended up with an unintentional tuple after converting a dictionary to a

Re: [Python-Dev] PEP 498 f-string: is it a preprocessor?

2015-08-11 Thread Eric V. Smith
On 08/10/2015 07:23 PM, Victor Stinner wrote: Le mardi 11 août 2015, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com a écrit : Oops, I was thinking of going the other way (str.format - f''). Yes, I think you're correct. Ah ok. But in any event, I don't see

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

2015-08-11 Thread Eric V. Smith
On 08/10/2015 04:12 PM, Mike Miller wrote: Here are my notes on PEP 498. 1. Title: Literal String Formatting - String Literal Formatting - Format String Expressions ? I like String Literal Formatting, but let me sleep on it. 2. Let's call them format strings not f-strings.

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

2015-08-11 Thread Alexander Walters
This may seam like a simplistic solution to i18n, but why not just add a method to string objects (assuming we implement f-strings) that just returns the original, unprocessed string. If the string was not an f-string, it just returns self. The gettext module can be modified, I think

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

2015-08-11 Thread Eric V. Smith
On 08/11/2015 11:09 AM, Alexander Walters wrote: This may seam like a simplistic solution to i18n, but why not just add a method to string objects (assuming we implement f-strings) that just returns the original, unprocessed string. If the string was not an f-string, it just returns self.

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

2015-08-11 Thread Barry Warsaw
On Aug 10, 2015, at 11:05 PM, ISAAC J SCHWABACHER wrote: code.putlines(f static char {entry.doc_cname}[] = { split_string_literal(escape_bytestring(docstr))}; { # nested! f #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase {entry.wrapperbase_cname}; #endif if entry.is_special else ''}

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread Guido van Rossum
I don't think it needs a PEP. See my response in the issue. On Tue, Aug 11, 2015 at 8:09 AM, Robert Collins robe...@robertcollins.net wrote: So, there's a patch on issue 9232 - allow trailing commas in function definitions - but there's been enough debate that I suspect we need a PEP.

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

2015-08-11 Thread Wes Turner
On Aug 11, 2015 10:10 AM, Alexander Walters tritium-l...@sdamon.com wrote: This may seam like a simplistic solution to i18n, but why not just add a method to string objects (assuming we implement f-strings) that just returns the original, unprocessed string. If the string was not an f-string,

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

2015-08-11 Thread ISAAC J SCHWABACHER
Now with syntax highlighting, if my email client cooperates: code.putlines(f static char {entry.doc_cname}[] = { split_string_literal(escape_bytestring(docstr))}; { # nested! f #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase {entry.wrapperbase_cname}; #endif if entry.is_special else

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

2015-08-11 Thread Alexander Walters
On 8/11/2015 11:16, Eric V. Smith wrote: On 08/11/2015 11:09 AM, Alexander Walters wrote: This may seam like a simplistic solution to i18n, but why not just add a method to string objects (assuming we implement f-strings) that just returns the original, unprocessed string. If the string was

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread Chris Barker - NOAA Federal
there's been enough debate that I suspect we need a PEP. I think we might just need another round of discussion here. Please no :-) Looking back at the previous discussion, it looked like it's all been said, and there was almost unanimous approval (with some key mild disapproval) for the

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

2015-08-11 Thread Wes Turner
On Aug 11, 2015 10:19 AM, Wes Turner wes.tur...@gmail.com wrote: On Aug 11, 2015 10:10 AM, Alexander Walters tritium-l...@sdamon.com wrote: This may seam like a simplistic solution to i18n, but why not just add a method to string objects (assuming we implement f-strings) that just returns

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread Alexander Walters
As a user who has banged my head against this more than once, its not a feature, its a bug, it does not need a pep (Guido said as much), just fix it. On 8/11/2015 11:31, Chris Barker - NOAA Federal wrote: there's been enough debate that I suspect we need a PEP. I think we might just need

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

2015-08-11 Thread Alexander Walters
On 8/11/2015 11:28, Wes Turner wrote: On Aug 11, 2015 10:19 AM, Wes Turner wes.tur...@gmail.com mailto:wes.tur...@gmail.com wrote: - [ ] review all string interpolation (for injection) * [ ] review every '%' * [ ] review every .format() * [ ] review every f-string (AND LOCALS AND

Re: [Python-Dev] trailing commas on statements

2015-08-11 Thread R. David Murray
On Wed, 12 Aug 2015 01:03:38 +1000, Chris Angelico ros...@gmail.com wrote: On Wed, Aug 12, 2015 at 12:46 AM, R. David Murray rdmur...@bitdance.com wrote: (If you wanted to fix an 'oops' trailing comma syntax issue, I'd vote for disallowing trailing commas outside of (). The number of times

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

2015-08-11 Thread Eric V. Smith
On 08/11/2015 01:25 PM, Sven R. Kunze wrote: Couldn't you just store the original format string at some __format_str__ attribute at the formatted string? Just in case you need it. x = f'{a}' = x = '{}'.format(a) # or whatever it turns out to be x.__format_str__ = '{a}' Yes. But I

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

2015-08-11 Thread Mike Miller
On 08/11/2015 06:47 AM, Eric V. Smith wrote: 2. Let's call them format strings not f-strings. The latter sounds slightly obnoxious, and also inconsistent with the others: r'' raw string u'' unicode object (string) f'' format string

Re: [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?

2015-08-11 Thread R. David Murray
On Tue, 11 Aug 2015 08:31:57 -0700, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Looking back at the previous discussion, it looked like it's all been said, and there was almost unanimous approval (with some key mild disapproval) for the idea, so what we need now is a

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

2015-08-11 Thread Sven R. Kunze
Couldn't you just store the original format string at some __format_str__ attribute at the formatted string? Just in case you need it. x = f'{a}' = x = '{}'.format(a) # or whatever it turns out to be x.__format_str__ = '{a}' On 11.08.2015 17:16, Eric V. Smith wrote: On 08/11/2015 11:09 AM,

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

2015-08-11 Thread Wes Turner
On Tue, Aug 11, 2015 at 10:52 AM, Alexander Walters tritium-l...@sdamon.com wrote: On 8/11/2015 11:28, Wes Turner wrote: On Aug 11, 2015 10:19 AM, Wes Turner wes.tur...@gmail.com wrote: - [ ] review all string interpolation (for injection) * [ ] review every '%' * [ ] review every

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

2015-08-11 Thread ISAAC J SCHWABACHER
I don't know about you, but I sure like this better than what you have: code.putlines(f static char {entry.doc_cname}[] = { split_string_literal(escape_bytestring(docstr))}; { # nested! f #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase {entry.wrapperbase_cname}; #endif if

Re: [Python-Dev] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread Steve Dower
We saw and fixed it before RC 1. I'll check whether that fix didn't stick, but go ahead, open an issue and assign me. Cheers, Steve Top-posted from my Windows Phone From: MRABmailto:pyt...@mrabarnett.plus.com Sent: ‎8/‎11/‎2015 17:25 To:

Re: [Python-Dev] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread MRAB
On 2015-08-12 02:05, Steve Dower wrote: We saw and fixed it before RC 1. I'll check whether that fix didn't stick, but go ahead, open an issue and assign me. It's issue 24847. From: MRAB

[Python-Dev] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread MRAB
As the subject says, I'm unable to import tkinter in Python 3.5.0rc1. The console says: C:\Python35python Python 3.5.0rc1 (v3.5.0rc1:1a58b1227501, Aug 10 2015, 05:18:45) [MSC v.1900 64 bit (AMD64)] on win32 Type help, copyright, credits or license for more information. import tkinter

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

2015-08-11 Thread Greg Ewing
Stefan Behnel wrote: Syntax highlighting and in-string expression completion should eventually help, once IDEs support it. Concerning that, this is going to place quite a burden on syntax highlighters. Doing it properly will require the ability to parse arbitrary Python expressions, or at

Re: [Python-Dev] Sorry folks, minor hiccup for Python 3.5.0rc1

2015-08-11 Thread Matthias Klose
On 08/11/2015 02:56 AM, Larry Hastings wrote: On 08/10/2015 05:55 PM, Larry Hastings wrote: I yanked the tarballs off the release page as soon as I suspected something. I'm rebuilding the tarballs and the docs now. If you grabbed the tarball as soon as it appeared, it's slightly out of date,