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 mahmoud
Recipients eric.smith, ezio.melotti, mahmoud, vstinner
Date 2015-04-21.18:31:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429641072.79.0.86637985213.issue24019@psf.upfronthosting.co.za>
In-reply-to
Content
Python already has one approach that fails to decode non-bytestrings: the .decode() method. 

This is about removing unicode barriers to entry and making the str constructor in Python 3 as succinctly useful as possible. There are several problems the helper does not solve:

1) Usage-wise, str/unicode is used to turn values into text. From a high-level perspective, the content does not change, only the representation format. Should this fundamental operation really require type inspection and explicit try/except blocks every single time? Or should it just work? sorted() does not raise an exception if the values are already sorted, why does str() raise an exception when the value is already a str?*

2) By and large, among developers, keyword arguments are viewed as "optional" arguments that have defaults which can be overridden. However, that is not the case here; str is not simply str(obj, encoding=sys.getdefaultencoding()). Explicitly passing the keyword argument breaks the call.

3) The helper does not help promote Python adoption when it must be copied and pasted it into new developer's projects. It does not help break down the misconception that unicode is a punishing concept to be around in Python.

* This question is posed here rhetorically, but I have gotten variations on it from multiple Python developers in training.
History
Date User Action Args
2015-04-21 18:31:12mahmoudsetrecipients: + mahmoud, vstinner, eric.smith, ezio.melotti
2015-04-21 18:31:12mahmoudsetmessageid: <1429641072.79.0.86637985213.issue24019@psf.upfronthosting.co.za>
2015-04-21 18:31:12mahmoudlinkissue24019 messages
2015-04-21 18:31:12mahmoudcreate