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 ncoghlan
Recipients doerwalter, ezio.melotti, lemburg, ncoghlan, serhiy.storchaka, vstinner
Date 2013-11-16.14:52:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384613529.16.0.079419034375.issue19619@psf.upfronthosting.co.za>
In-reply-to
Content
The only reasonable way to accurately represent "anything that exposes a buffer memoryview can read" as a type check is to write an appropriately duck-typed ABC. You can't enumerate all the types that the binary codecs accept as input, because that list of types isn't finite (unlike the output types, which are far more tightly constrained).

I'd also be fine with Serhiy's suggestion of a private "non Unicode codec" set that is maintained by hand and checked *before* the codec operations in the codec methods - that then just becomes an internal implementation detail to improve the efficiency of the output type checks where we have the additional info needed to save the interpreter some work.
History
Date User Action Args
2013-11-16 14:52:09ncoghlansetrecipients: + ncoghlan, lemburg, doerwalter, vstinner, ezio.melotti, serhiy.storchaka
2013-11-16 14:52:09ncoghlansetmessageid: <1384613529.16.0.079419034375.issue19619@psf.upfronthosting.co.za>
2013-11-16 14:52:09ncoghlanlinkissue19619 messages
2013-11-16 14:52:08ncoghlancreate