Author Matthis Thorade
Recipients Matthis Thorade, christoph, georg.brandl, mark, r.david.murray, tim.peters
Date 2017-02-10.13:10:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I found this bug when trying to write a doctest that passes on Python 3.5 and Python 2.7.9.

The following adapted example passes on Python2, but fails on Python3:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
def f():
    >>> f()
    return "xyz"

if __name__ == "__main__":
    import doctest

I think a nice solution could be to add a new directive so that I can use the following

def myUnic():
    This is a small demo that just returns a string.
    >>> myUnic()
    u'abc' # doctest: +ALLOW_UNICODE
    return 'abc'

I asked the same question here:
Date User Action Args
2017-02-10 13:10:47Matthis Thoradesetrecipients: + Matthis Thorade, tim.peters, georg.brandl, mark, christoph, r.david.murray
2017-02-10 13:10:47Matthis Thoradesetmessageid: <>
2017-02-10 13:10:47Matthis Thoradelinkissue3955 messages
2017-02-10 13:10:47Matthis Thoradecreate