23 Jun
2013
23 Jun
'13
1:42 p.m.
On 23 June 2013 09:39, Greg Ewing <greg.ewing@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?