[Python-ideas] os.path.isbinary

Ryan rymg19 at gmail.com
Thu Aug 1 04:45:33 CEST 2013


What about something like this:

https://github.com/ahupp/python-magic

And, I explained the joke in my last post.

Steven D'Aprano <steve at pearwood.info> wrote:

>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
>_______________________________________________
>Python-ideas mailing list
>Python-ideas at python.org
>http://mail.python.org/mailman/listinfo/python-ideas

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130731/13b91aad/attachment.html>


More information about the Python-ideas mailing list