[Python-ideas] Object grabbing

MRAB python at mrabarnett.plus.com
Mon May 2 19:46:25 EDT 2016


On 2016-05-02 23:59, Erik wrote:
> On 02/05/16 23:34, Koos Zevenhoven wrote:
>> It seems to me the signal-to-noise ratio of this thread is getting
>> worse.
>
> I tend to agree.
>
>> Déjà vu (or French for 'already seen', if unicode fails you).
>
> What has translating one human language phrase to another human language
> got to do with Unicode?
>
The French phrase has accents.

>> What I'm suggesting (in addition to the actual suggestion) is not to
>> allow plain .attr attribute access inside a with statement "with
>> multiple expressions". Kind of the same way as, for instance, break
>> and continue are not allowed outside loops:
>
> You're now suggesting that the lexer/parser changes behaviour
> dynamically depending on what has been seen before.
>
>  > Kind of the same way as, for instance, break
>  > and continue are not allowed outside loops:
>
> Not the same thing at all. Those are absolute syntax rules. What you are
> suggesting is conditional based on context.
>
The use of 'break' and 'continue' are also conditional on context; they 
can be used only within a loop.

Another example: an empty 'raise' statement can be used only within an 
'except' suite.

This suggestion is that a leading .attr can be used only within a 'with' 
statement that has a single expression.



More information about the Python-ideas mailing list