[Python-ideas] Short form for keyword arguments and dicts

Joshua Landau joshua.landau.ws at gmail.com
Sun Jun 23 15:42:48 CEST 2013


On 23 June 2013 09:39, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Joshua Landau wrote:
>>
>> What about:
>>
>> class Foo:
>>     bar = bar
>
> That would be going too far, I think. I can't remember *ever*
> needing to write code like that in a class.

I have. Like, once, though.

> Also, it's a somewhat dubious thing to write anyway, since it
> relies on name lookups in a class scope working dynamically.
> While they currently do in CPython, I wouldn't like to rely on
> that always remaining the case.

Is this not a defined behaviour? I wouldn't expect this to change
before 4.0, and that's a different ballgame.
Does it break in some other implementations?


More information about the Python-ideas mailing list