[Python-Dev] Re: Unicode in doctests (original) (raw)
Fredrik Lundh fredrik at pythonware.com
Fri Dec 3 14:38:04 CET 2004
- Previous message: [Python-Dev] Unicode in doctests
- Next message: [Python-Dev] Re: Unicode in doctests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Bjorn Tillenius wrote:
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.
really? if a function is expected to print "öl", is it alright to print "\u00f6l" instead? wouldn't you complain if your newspaper used Unicode escapes in headlines instead of Swedish characters?
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.
repr() always generates the same output, no matter what encoding you use. just use repr, and you're done.
- Previous message: [Python-Dev] Unicode in doctests
- Next message: [Python-Dev] Re: Unicode in doctests
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]