One-liner blocks (was Re: accessing a functions var from a subfunction.)

Aahz aahz at
Thu Apr 17 02:02:25 CEST 2003

In article <gcjna.35728$T34.931514 at>,
Alex Martelli  <aleax at> wrote:
>Aahz wrote:
>> In article <iCzma.16405$T34.518484 at>,
>> Alex Martelli  <aleax at> wrote:
>>>def test():
>>>    class Bunch: pass
>>>    loc = Bunch()
>>>    loc.count = 0
>>>    def inc_count():
>>>        loc.count += 1
>>>    inc_count()
>>>    inc_count()
>>>    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           <*>

Why is this newsgroup different from all other newsgroups?

More information about the Python-list mailing list