[Python-ideas] Remove tty module

Cameron Simpson cs at zip.com.au
Thu Jul 25 00:56:09 CEST 2013


On 24Jul2013 11:01, M.-A. Lemburg <mal at egenix.com> wrote:
| cbreak and raw modes are needed for e.g. games or editors that
| need low-level access to the keyboard.

Raw mode is also needs to talk to arbitrary serial devices. I've
written code for such, and having some line discipline in the way
would be disasterous. Not everything is a keyboard:-) (Disclaimer:
that app was in Java, but the situation in Python would be unchanged.)

I see "tty" only supplies two functions and explicitly requires
termios anyway; why weren't these functions just provided as
convenience routines inside termios?
(I can imagine someone forward thinking saying "this could work elsewhere".)

That said, termios could be ported to other platforms fairly easily,
at least for most of it.

I certainly wrote myself a termios layer in C for V7 UNIX, which
didn't have it but did have the older tty setup intrerfaces. Any
other OS presenting a serial line control library could probably
be targeted nearly as easily for the basics (raw mode, tty speed,
parity et al).

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

That is 27 years ago, or about half an eternity in computer years.
        - Alan Tibbetts


More information about the Python-ideas mailing list