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 cito
Recipients cito, georg.brandl
Date 2008-03-02.19:46:57
SpamBayes Score 0.57186353
Marked as misclassified No
Message-id <1204487220.46.0.904733468424.issue2217@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the quick explanation. I understand that class scopes don't
extend and this is documented behavior.

However, the question is why the if clause is executed in a scope of its
own and where this is documented.

You would expect that the problematic generator expression is equivalent
to the following code which works fine:

class A:
    a = 'test'
    def __g(a):
        for c in a:
            if c in a:
                yield c
    tuple(__g(a))
History
Date User Action Args
2008-03-02 19:47:00citosetspambayes_score: 0.571864 -> 0.57186353
recipients: + cito, georg.brandl
2008-03-02 19:47:00citosetspambayes_score: 0.571864 -> 0.571864
messageid: <1204487220.46.0.904733468424.issue2217@psf.upfronthosting.co.za>
2008-03-02 19:46:58citolinkissue2217 messages
2008-03-02 19:46:58citocreate