This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients cito, georg.brandl
Date 2008-03-02.21:07:46
SpamBayes Score 0.11828059
Marked as misclassified No
Message-id <1204492067.93.0.947119810532.issue2217@psf.upfronthosting.co.za>
In-reply-to
Content
The actual equivalent would be

class A:
    a = 'test'
    def __g(_x):
        for c in _x:
            if c in a:
                yield c
    tuple(__g(a))

i.e. the outmost iterator is evaluated in the enclosing scope; not the
if clause is in its own scope, but the whole genexp.
History
Date User Action Args
2008-03-02 21:07:48georg.brandlsetspambayes_score: 0.118281 -> 0.11828059
recipients: + georg.brandl, cito
2008-03-02 21:07:47georg.brandlsetspambayes_score: 0.118281 -> 0.118281
messageid: <1204492067.93.0.947119810532.issue2217@psf.upfronthosting.co.za>
2008-03-02 21:07:46georg.brandllinkissue2217 messages
2008-03-02 21:07:46georg.brandlcreate