A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-December/050183.html below:

[Python-Dev] Unicode in doctests

[Python-Dev] Unicode in doctests [Python-Dev] Unicode in doctestsBjorn Tillenius bjoti at home.se
Wed Dec 1 23:19:22 CET 2004
There are some issues regarding the use of unicode in doctests. Consider
the following three tests.

    >>> foo = u'föö'
    >>> foo
    u'f\xf6\xf6'

    >>> foo
    u'f\u00f6\u00f6'

    >>> foo
    u'föö'

To me, those are identical. At least string comparison shows that
u'f\xf6\xf6' == u'f\u00f6\u00f6' == u'föö'. Yet, only the first one of
the tests passes, the other two fail. And that's if the tests are within
a doc string, where I can specify the encoding used. If DocFileSuite is
being used, there's no way of specify the encoding, thus all tests will
fail.

Is it supposed to be like this, or have I missed something? If I could
specify the encoding for DocFileSuite to use, I would at least be
partially happy.

Regards,

Bjorn
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4