Hi

While working on the patch for the invalid unicode codepoints in the
junitxml output I discovered it's fairly hard to create a unicode
strings in the the test suite.  Currently I decided to use
py.builtins._totext() to replace unicode string literals.  And to get
access to the unichr() builtin I've done this little hack:

def foo():
    global unichr
    try:
        unichr(65)
    except NameError:
        unichr = chr

I think both are fairly fine, though am surprised by the leading
underscore in _totext(), I'd have rather expected a
py.builtin.unicode() name or so.  And if the unichr hack is acceptable
would it be worth to create py.builtins.unichr()?

Regards
Floris

-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to