New submission from Mark Summerfield <[EMAIL PROTECTED]>:

# This program works fine with Python 2.5 and 2.6:
def f():
    """
    >>> f()
    'xyz'
    """
    return "xyz"

if __name__ == "__main__":
    import doctest
    doctest.testmod()


But if you put the statement "from __future__ import unicode_literals"
at the start then it fails:
File "/tmp/test.py", line 5, in __main__.f
Failed example:
    f()
Expected:
    'xyz'
Got:
    u'xyz'

I don't know if it is a bug or a feature but I didn't see any mention of
it in the bugs or docs so thought I'd mention it.

----------
components: Library (Lib)
messages: 73710
nosy: mark
severity: normal
status: open
title: maybe doctest doesn't understand unicode_literals?
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3955>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to