Title: Termios module documentation is extremely lacking
Type: Stage:
Components: Documentation Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: dan.merillat, docs@python
Priority: normal Keywords:

Created on 2020-11-19 07:54 by dan.merillat, last changed 2020-11-19 08:02 by dan.merillat.

Messages (2)
msg381393 - (view) Author: Dan Merillat (dan.merillat) Date: 2020-11-19 07:54
"The interpretation of the flags and the speeds as well as the indexing in the cc array must be done using the symbolic constants defined in the |termios| module."  (termios links to itself)

These constants are not listed in the documentation and the termios module is installed as a shared library so you can't read it without going to the source.

Furthermore the example in the documentation uses the following example:

new = termios.tcgetattr(fd)
new[3] = new[3] & ~termios.ECHO          # lflags

Which is explicitly against the documentation on the same page.
This has led to most searches on the net turning up people using magic numbers in places instead of symbolic values.

Inserting a list of constants with an extremely brief description would improve the module documentation dramatically.
msg381394 - (view) Author: Dan Merillat (dan.merillat) Date: 2020-11-19 08:02
Correction, the example source in the documentation is correct as there's no symbolic names for the tty attributes array, only the cc field.
Date User Action Args
2020-11-19 08:02:21dan.merillatsetmessages: + msg381394
2020-11-19 07:54:10dan.merillatcreate