This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients ezio.melotti, mjpieters, ned.deily, serhiy.storchaka, terry.reedy, vstinner
Date 2015-03-04.20:43:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
What about just 's = unicode(s)'?  The doc says


    Called to implement unicode() built-in; should return a Unicode object. When this method is not defined, string conversion is attempted, and the result of string conversion is converted to Unicode using the system default encoding."

but the latter part seems not to be true for unicode subclasses.

>>> class F(unicode):
	def __str__(self): raise TypeError()

>>> f = F()
>>> u = unicode(f)
>>> type(u)
<type 'unicode'>
Date User Action Args
2015-03-04 20:43:13terry.reedysetrecipients: + terry.reedy, mjpieters, vstinner, ned.deily, ezio.melotti, serhiy.storchaka
2015-03-04 20:43:13terry.reedysetmessageid: <>
2015-03-04 20:43:13terry.reedylinkissue23583 messages
2015-03-04 20:43:13terry.reedycreate