Commit 8b41a547 authored by Stefan Behnel's avatar Stefan Behnel

adapt doctest to semantic change in Py3.5 (due to PEP 448)

parent f8b952c1
import sys
IS_PY35 = sys.version_info >= (3, 5)
def empty(): def empty():
""" """
>>> empty() >>> empty()
...@@ -98,7 +103,7 @@ def item_creation_sideeffect(L, sideeffect, unhashable): ...@@ -98,7 +103,7 @@ def item_creation_sideeffect(L, sideeffect, unhashable):
>>> {1:2, sideeffect(2): 3, 3: 4, unhashable(4): 5, sideeffect(5): 6} # doctest: +ELLIPSIS >>> {1:2, sideeffect(2): 3, 3: 4, unhashable(4): 5, sideeffect(5): 6} # doctest: +ELLIPSIS
Traceback (most recent call last): Traceback (most recent call last):
TypeError: ...unhashable... TypeError: ...unhashable...
>>> L >>> L if IS_PY35 else (L + [5])
[2, 4] [2, 4, 5]
""" """
return {1:2, sideeffect(2): 3, 3: 4, unhashable(4): 5, sideeffect(5): 6} return {1:2, sideeffect(2): 3, 3: 4, unhashable(4): 5, sideeffect(5): 6}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment