""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
| This is probably not correct. However, in 2.6, you could write
| that as
|
| if type(s) is bytes: s = unicode(s, 'utf-8')
|
| as bytes is str in 2.6. If you want to support even older
| versions, do
|
| try:
|    bytes
| except NameError:
|    bytes = str
|
| somewhere, then write the code as I proposed above.

This is exactly the sort of thing that should be and I expect will be in 
the conversion docs. 



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to