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 r.david.murray
Recipients Guillaume.Bouchard, docs@python, r.david.murray
Date 2011-12-06.13:12:16
SpamBayes Score 1.3347101e-12
Marked as misclassified No
Message-id <1323177137.13.0.74081855.issue13538@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with you that this is inconsistent.  However, having str raise an error is pretty much a non-starter as a suggestion.  str always falls back to the repr; in general str(obj) should always return some value, otherwise the assumptions of a *lot* of Python code would be broken.

Personally I'm not at all sure why str takes encoding and errors arguments (I never use them). I'd rather there be only one way to do that, decode.  In other words, why do we have special case support for byte strings in the str conversion function?

But I don't think that can be changed either, so I think we are stuck with documenting the existing situation better.  Do you want to propose a doc patch?
History
Date User Action Args
2011-12-06 13:12:17r.david.murraysetrecipients: + r.david.murray, docs@python, Guillaume.Bouchard
2011-12-06 13:12:17r.david.murraysetmessageid: <1323177137.13.0.74081855.issue13538@psf.upfronthosting.co.za>
2011-12-06 13:12:16r.david.murraylinkissue13538 messages
2011-12-06 13:12:16r.david.murraycreate