[Python-Dev] Path inherits from string (original) (raw)

Neil Schemenauer nas at arctrix.com
Sat Jan 28 03:52:26 CET 2006


Ian Bicking <ianb at colorstudy.com> wrote:

OTOH, str(path) will break unicode filenames. And unicode() breaks anything that simply desires to pass data through without effecting its encoding.

That general problem was the motivation for PEP 349. Originally I suggested adding a new built-in. However, Guido's suggestion of allowing str() to return unicode objects works okay too and that's the way the current PEP is written. With Python 2.5 you can do it the ugly way using a str format (e.g. '%s' % obj).

Neil



More information about the Python-Dev mailing list