using binary in python

Marko Rauhamaa marko at pacujo.net
Mon Nov 9 09:32:28 EST 2015


Chris Angelico <rosuav at gmail.com>:

> On Tue, Nov 10, 2015 at 12:25 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> but personally I would prefer the programming language
>> just give me the OS, warts and all.
>
> Then you don't want Python. The point of Python is to give you data
> types like "list", "dict", "int" (not a machine word but a bignum),
> and so on.

Those examples are out of the scope of the OS abstraction.

> It's NOT meant to be a thin wrapper around what your OS
> offers.

Thankfully, Python hasn't yet taken that away. I can do a lot of nice
things with socket.* and os.* that are unavailable in, say, Java.

> Python's string is a Unicode string, not a series of bytes (as is C's
> char* type), because human text is better represented as Unicode than
> as bytes;

No problem there, either.

> so it stands to reason that Python's files should be able to contain
> text,

Yes, and lists and dicts and ints and objects and all. No problem there.

However, when filenames and sys.stdin deal with text, things are getting
iffy.


Marko



More information about the Python-list mailing list