[Python-ideas] os.path.isbinary

Steven D'Aprano steve at pearwood.info
Thu Aug 1 04:11:19 CEST 2013


On 01/08/13 10:25, Ryan wrote:
> I just realized I misexpressed myself...again. I meant ASCII or binary, not text or binary. Kind of like the old FTP programs. The implementation would determine if it was ASCII or binary.

Still can't be done reliably, but even if it could, what's so special about ASCII? Should we have dozens of such functions?

isascii
isbig5
iskoi8u
iskoi8r

and so on?


The concept of "isbinary" is fundamentally flawed. The concept of "try to guess what sort of data a file might plausibly contain" is not flawed, but is a much, much bigger problem than is suitable for a simple os.path function.


-- 
Steven


More information about the Python-ideas mailing list