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 <rep...@bugs.python.org>
<http://bugs.python.org/issue27607>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to