[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-17 Thread Guido van Rossum

Guido van Rossum added the comment:

Fixed, see http://bugs.python.org/issue28556#msg281317

New changeset 75c7bc2c1ad8 by Guido van Rossum in branch '3.5':
Issue #28556: upstream improvements to docstrings and error messages by Ivan 
Levkivskyi (#331)
https://hg.python.org/cpython/rev/75c7bc2c1ad8

New changeset 294525aac5eb by Guido van Rossum in branch '3.6':
Issue #28556: upstream improvements to docstrings and error messages by Ivan 
Levkivskyi (#331) (3.5->3.6)
https://hg.python.org/cpython/rev/294525aac5eb

New changeset 30f154d9abf0 by Guido van Rossum in branch 'default':
Issue #28556: upstream improvements to docstrings and error messages by Ivan 
Levkivskyi (#331) (3.6->3.7)
https://hg.python.org/cpython/rev/30f154d9abf0

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Thank you for catching this corner case!

I have made a PR upstream based on your patch: 
https://github.com/python/typing/pull/350

As I understand the fix will go in 3.6.1 and 3.5.4

--

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Guido van Rossum

Changes by Guido van Rossum :


--
assignee:  -> levkivskyi
nosy: +levkivskyi

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +gvanrossum
stage:  -> patch review

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-11 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
type: crash -> behavior
versions:  -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-11 Thread Spiro Sideris

New submission from Spiro Sideris:

The typing.Union module raises a RecursionError when comparing a Union with no 
additional tree_args to a type that is not a Union.

An example of the stack trace with the added test looks like the following:

0:00:00 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
  File "/Users/spiro/Development/open_source/cpython/Lib/test/test_typing.py", 
line 221, in test_union_compare_other
self.assertNotEqual(Union, object)
  File "/Users/spiro/Development/open_source/cpython/Lib/unittest/case.py", 
line 827, in assertNotEqual
if not first != second:
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  [Previous line repeated 233 more times]
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 759, 
in __eq__
if not isinstance(other, _Union):
RecursionError: maximum recursion depth exceeded in __instancecheck__

test_typing failed

1 test failed:
test_typing

Total duration: 316 ms
Tests result: FAILURE

The test compares a Union with no tree_args to another type.

--
components: Library (Lib)
files: spirowork.patch
keywords: patch
messages: 285279
nosy: spiside
priority: normal
severity: normal
status: open
title: typing.Union raises RecursionError when comparing Union to other type
type: crash
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46264/spirowork.patch

___
Python tracker 

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