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 barry
Recipients barry
Date 2013-03-17.14:42:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363531378.76.0.0837150963685.issue17445@psf.upfronthosting.co.za>
In-reply-to
Content
This came up at the Pycon 2013 Python 3 porting clinic.  There are many cases in the stdlib that claim (either explicitly or implicitly) to accept bytes or strings, but that don't return the type of the arguments they accept.  An example is urllib.parse.quote() which accepts bytes or str but always returns str.  A similar example brought up at the clinic was difflib, which accepts both types, and works internally on both, but crashes when joining the results for return.

It should be policy for the stdlib (i.e. codified in an informational PEP and including bug reports, because they *are* bugs, not features or baked-in API) where bytes or str are accepted but the right things are not done (i.e. return the type you accept).

This bug captures the principle, and probably should be closed once such a PEP is accepted, with individual bugs opened for each individual case.
History
Date User Action Args
2013-03-17 14:42:58barrysetrecipients: + barry
2013-03-17 14:42:58barrysetmessageid: <1363531378.76.0.0837150963685.issue17445@psf.upfronthosting.co.za>
2013-03-17 14:42:58barrylinkissue17445 messages
2013-03-17 14:42:58barrycreate