[issue27607] Enums never match if imported from another file

2016-07-24 Thread Sylvia van Os

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



[issue27607] Enums never match if imported from another file

2016-07-24 Thread Sylvia van Os

Sylvia van Os added the comment:

For what it's worth, I am not opposed to having this issue closed. As I am new 
to reporting anything on the Python issue tracker and was uncertain on how 
relevant the PEP in question was, I figured it would be better to report this 
anyway just in case.

--

___
Python tracker 
<http://bugs.python.org/issue27607>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27607] Enums never match if imported from another file

2016-07-24 Thread Sylvia van Os

Sylvia van Os added the comment:

Importing it from a third module indeed works without issues and makes both 
isinstance() calls return True, yes.

--

___
Python tracker 
<http://bugs.python.org/issue27607>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Sylvia van Os

Changes by Sylvia van Os :


Removed file: 
http://bugs.python.org/file43867/a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip

___
Python tracker 
<http://bugs.python.org/issue27607>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Sylvia van Os

Sylvia van Os added the comment:

My apologies, I can't get that test case to run here either. Here is a slightly 
older one that does reproduce the issue too.

I specifically run it with python3 main.py.

--
Added file: http://bugs.python.org/file43877/issue27607.zip

___
Python tracker 
<http://bugs.python.org/issue27607>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com