[New-bugs-announce] [issue27607] Enums never match if imported from another file

Sylvia van Os report at bugs.python.org
Sun Jul 24 11:46:17 EDT 2016


New submission from Sylvia van Os:

If main imports another file, and this file imports an Enum class from main, isinstance will return false for Enum variables set in this file, causing the Enums to never match.

A proof of concept is added as a zip. I thank Kwpolska for simplifying my initial proof of concept.

To test this, unzip both files into the same directory and launch main.py with Python 3. I have succesfully been able to reproduce this issue on Python 3.4.3.

>From discussion on IRC with Vgr, PEP 499 may be related to this issue: https://www.python.org/dev/peps/pep-0499/.

----------
components: Interpreter Core
files: a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip
messages: 271164
nosy: Kwpolska, SylvieLorxu
priority: normal
severity: normal
status: open
title: Enums never match if imported from another file
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file43867/a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip

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


More information about the New-bugs-announce mailing list