[Python-ideas] Statement local functions and classes (aka PEP 3150 is dead, say 'Hi!' to PEP 403)

Nick Coghlan ncoghlan at gmail.com
Wed Oct 19 13:52:11 CEST 2011


On Wed, Oct 19, 2011 at 7:43 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 10/19/2011 2:44 AM, David Townshend wrote:
>>
>> Regarding out of order execution: how is pep 3150 any worse than "x = y
>> if z else w"?
>
> A lot of people did not like that version of a conditional expression and
> argued against it. If it is used to justify other backwards constructs, I
> like it even less.

I happened to be doing a lot of string formatting today, and it
occurred to me that because Python doesn't allow implicit string
interpolation, *all* string formatting is based on forward references
- we define placeholders in the format strings and only fill them in
later during the actual formatting call.

PEP 3150 is essentially just about doing that for arbitrary
expressions by permitting named placeholders that are filled in from
the following suite.

I agree that using any parallels with conditional expressions as
justification for out of order execution is a terrible idea, though.
The chosen syntax was definitely a case of "better than the error
prone status quo and not as ugly as the other alternatives proposed"
rather than "oh, this is a wonderful way to do it" :P

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list