I'm having troubles with unicode strings in tuples when using doctests.
This is a minimal script:
from __future__ import unicode_literals, print_function
import numpy as np
def some_api_function():
# do stuff
return "bla", np.array([0,1,2])
print(some_api_function())
Running with python3:
('bla', array([0, 1, 2]))
Running with python2:
(u'bla', array([0, 1, 2]))
Ultimately I would like to write a doc string example that can be checked with a doctest.
obviously this will only work with python3:
Examples:
>>> some_api_function()
('bla', array([0, 1, 2]))
I'm looking for a solution that works for both python2 and python3 and does not make the examples too obscure to understand.
EDIT: Updated the code examples and tried to make it easier to understand my issues.