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 spiside
Recipients spiside
Date 2017-01-11.23:03:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484175780.67.0.919413735976.issue29246@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-01-11 23:03:00spisidesetrecipients: + spiside
2017-01-11 23:03:00spisidesetmessageid: <1484175780.67.0.919413735976.issue29246@psf.upfronthosting.co.za>
2017-01-11 23:03:00spisidelinkissue29246 messages
2017-01-11 23:03:00spisidecreate