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

2015-08-09 Thread Sven R. Kunze
After I read Nick's proposal and pondering over the 'f' vs. 'r' examples, I like the 'i' prefix more (regardless of the internal implementation). The best solution would be "without prefix and '{var}' only" syntax. Not sure if that is possible at all; I cannot remember using '{...}' anywhere

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

2015-08-09 Thread Wes Turner
On Aug 9, 2015 8:14 PM, "David Mertz" wrote: > > On Sun, Aug 9, 2015 at 11:22 AM, Eric V. Smith wrote: >> >> I think it has to do with the nature of the programs that people write. >> I write software for internal use in a large company. In the last 13 >> years there, I've written literally hundr

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

2015-08-09 Thread David Mertz
Y'know, I just read a few more posts over on python-ideas that I had missed somehow. I saw Guido's point about `**locals()` being too specialized and magical for beginners, which I agree with. And it's the other aspect of "magic" that makes me not like f-strings. The idea of *implicitly* getting

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

2015-08-09 Thread David Mertz
On Sun, Aug 9, 2015 at 11:22 AM, Eric V. Smith wrote: > > I think it has to do with the nature of the programs that people write. > I write software for internal use in a large company. In the last 13 > years there, I've written literally hundreds of individual programs, > large and small. I just

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

2015-08-09 Thread Eric V. Smith
On 8/9/2015 9:02 PM, Eric V. Smith wrote: > On 8/9/2015 8:24 PM, Peter Ludemann wrote: >> What if logging understood lambda? (By testing for types.FunctionType). >> This is outside PEP 498, but there might be some recommendations on how >> "lazy" evaluation should be done and understood by some fun

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

2015-08-09 Thread Eric V. Smith
On 8/9/2015 8:24 PM, Peter Ludemann wrote: > What if logging understood lambda? (By testing for types.FunctionType). > This is outside PEP 498, but there might be some recommendations on how > "lazy" evaluation should be done and understood by some functions. > > e.g.: > log.info

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

2015-08-09 Thread MRAB
On 2015-08-10 01:24, Peter Ludemann via Python-Dev wrote: What if logging understood lambda? (By testing for types.FunctionType). [snip] Why not use 'callable'? ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinf

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

2015-08-09 Thread Peter Ludemann via Python-Dev
What if logging understood lambda? (By testing for types.FunctionType). This is outside PEP 498, but there might be some recommendations on how "lazy" evaluation should be done and understood by some functions. e.g.: log.info(lambda: f'{foo} just did a {bar} thing') It's not pretty, but it's not

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

2015-08-09 Thread Brett Cannon
On Sun, Aug 9, 2015, 13:51 Peter Ludemann via Python-Dev < python-dev@python.org> wrote: Most of my outputs are log messages, so this proposal won't help me because (I presume) it does eager evaluation of the format string and the logging methods are designed to do lazy evaluation. Python doesn't

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

2015-08-09 Thread Peter Ludemann via Python-Dev
Most of my outputs are log messages, so this proposal won't help me because (I presume) it does eager evaluation of the format string and the logging methods are designed to do lazy evaluation. Python doesn't have anything like Lisp's "special forms", so there doesn't seem to be a way to implicitly

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

2015-08-09 Thread Eric V. Smith
On 8/9/2015 1:38 PM, Brett Cannon wrote: > > > On Sun, 9 Aug 2015 at 01:07 Stefan Behnel > wrote: > > Eric V. Smith schrieb am 08.08.2015 um 03:39: > > Following a long discussion on python-ideas, I've posted my draft of > > PEP-498. It describes the "f-s

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

2015-08-09 Thread Brett Cannon
On Sun, 9 Aug 2015 at 01:07 Stefan Behnel wrote: > Eric V. Smith schrieb am 08.08.2015 um 03:39: > > Following a long discussion on python-ideas, I've posted my draft of > > PEP-498. It describes the "f-string" approach that was the subject of > > the "Briefer string format" thread. I'm open to a

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

2015-08-09 Thread Eric V. Smith
On 8/8/2015 9:08 PM, Tim Delaney wrote: > On 8 August 2015 at 11:39, Eric V. Smith > wrote: > > Following a long discussion on python-ideas, I've posted my draft of > PEP-498. It describes the "f-string" approach that was the subject of > the "Briefer string

[Python-Dev] Reminder: the "3.5" branch in CPython trunk is now 3.5.1

2015-08-09 Thread Larry Hastings
As I write this email I'm tagging Python 3.5.0 release candidate 1. This is the moment that we switch over to our new experimental workflow, where we use Bitbucket and pull requests for all future changesets that will get applied to 3.5.0. The Bitbucket repository isn't ready yet, and I'm s

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

2015-08-09 Thread Stefan Behnel
Stefan Behnel schrieb am 09.08.2015 um 10:06: > Eric V. Smith schrieb am 08.08.2015 um 03:39: >> Following a long discussion on python-ideas, I've posted my draft of >> PEP-498. It describes the "f-string" approach that was the subject of >> the "Briefer string format" thread. I'm open to a better

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

2015-08-09 Thread Stefan Behnel
Eric V. Smith schrieb am 08.08.2015 um 03:39: > Following a long discussion on python-ideas, I've posted my draft of > PEP-498. It describes the "f-string" approach that was the subject of > the "Briefer string format" thread. I'm open to a better title than > "Literal String Formatting". > > I ne