[Python-Dev] PEP 3101 Update

Talin talin at acm.org
Fri May 19 19:24:37 CEST 2006


Guido van Rossum wrote:
> [on escaping]
> 
>> There is another solution to this which is equally subtle, although
>> fairly straightforward to parse. It involves defining the rules for
>> escapes as follows:
>>
>>     '{{' is an escaped '{'
>>     '}}' is an escaped '}', unless we are within a field.
>>
>> So you can write things like {0:10,{1}}, and the final '}}' will be
>> parsed as two separate closing brackets, since we're within a field
>> definition.
>>
>>  From a parsing standpoint, this is unambiguous, however I've held off
>> on suggesting it because it might appear to be ambiguous to a casual 
>> reader.
> 
> 
> Sure. But I still think there isn't enough demand for variable
> expansion *within* a field to bother. When's the lats time you used a
> * in a % format string? And how essential was it?

True. I'm mainly trying to avoid excess debate by not dropping existing 
features unecessarily. (Otherwise, you spend way to much time arguing 
with the handful of people out there that do rely on that use case.) But 
if you want to use your special "BDFL superpower" to shortcut the 
debate, I'm fine with that :)

> BTW I think we should move this back to the py3k list -- the PEP is
> 3101 after all. That should simplify the PEP a bit because it no
> longer has ti distinguish between str and unicode. If we later decide
> to backport it to 2.6 it should be easy enough to figure out what to
> do with str vs. unicode (probably the same as we do for %).

All right; Although my understanding is that the PEP should be escalated 
to c.l.p at some point before acceptance, and I figured py-dev would be 
a reasonable intermediate point before that. But it sounds like 3101 is 
going to go back into the shop for the moment, so that's a non-issue.

Since you seem to be in a PEP-review mode, could you have a look at 
3102? In particular, it seems that all of the controversies on that one 
have quieted down; Virtually everyone seems in favor of the first part, 
and you have already ruled in favor of the second part. So I am not sure 
that there is anything more to discuss.

Perhaps I should go ahead and put 3102 on c.l.p at this point.

-- Talin


More information about the Python-Dev mailing list