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 mark.dickinson
Recipients daniel.urban, ethan.furman, mark.dickinson
Date 2013-04-27.21:01:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367096486.18.0.183635163843.issue17853@psf.upfronthosting.co.za>
In-reply-to
Content
Isn't this just a consequence of Python's usual name-lookup rules?  In this code:

    def test():
        class Season(Enum):
            SPRING = Season()

the class definition in 'test' amounts to a local assignment to the name 'Season'.  So the occurrence of 'Season' in the class definition is bound to that function local (at bytecode level, it's looked up using LOAD_DEREF instead of LOAD_NAME).

I find it difficult to see how one could 'fix' this without significant changes to the way that Python does name resolution.
History
Date User Action Args
2013-04-27 21:01:26mark.dickinsonsetrecipients: + mark.dickinson, daniel.urban, ethan.furman
2013-04-27 21:01:26mark.dickinsonsetmessageid: <1367096486.18.0.183635163843.issue17853@psf.upfronthosting.co.za>
2013-04-27 21:01:26mark.dickinsonlinkissue17853 messages
2013-04-27 21:01:26mark.dickinsoncreate