[issue14972] listcomp with nested classes

josmiley report at bugs.python.org
Thu May 31 23:40:55 CEST 2012


New submission from josmiley <joel-murielle at sfr.fr>:

# this runs with python2.7, not with python3.2
class Foo(object):

    class Bar(object):
        pass

    Attr = [Bar()for n in range(10)]

# solved in this way ...
class Foo(object):

    class Bar(object):
        pass

    Attr = []
    for n in range(10): Attr.append(Bar())

----------
messages: 162022
nosy: josmiley
priority: normal
severity: normal
status: open
title: listcomp with nested classes
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14972>
_______________________________________


More information about the Python-bugs-list mailing list