One-liner blocks (was Re: accessing a functions var from a subfunction.)
aahz at pythoncraft.com
Thu Apr 17 02:02:25 CEST 2003
In article <gcjna.35728$T34.931514 at news2.tin.it>,
Alex Martelli <aleax at aleax.it> wrote:
>> In article <iCzma.16405$T34.518484 at news2.tin.it>,
>> Alex Martelli <aleax at aleax.it> wrote:
>>> class Bunch: pass
>>> loc = Bunch()
>>> loc.count = 0
>>> def inc_count():
>>> loc.count += 1
>>> print loc.count
>> Note that Guido deeply regrets permitting one-line blocks; this is
>> something he may try fixing for Python 3.0.
>Forcing linebreak after each & every colon? Oh well -- he's probably
>getting bribes from large-screen and vertical-aspect-ratio monitor
>manufacturers, is my guess...;-)
The reason I mentioned it is because I did indeed miss your
"class Bunch: pass" the first time I read your code.
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
Why is this newsgroup different from all other newsgroups?
More information about the Python-list