This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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, iritkatriel
Priority: normal Keywords:

Created on 2020-11-19 07:54 by dan.merillat, last changed 2022-04-11 14:59 by admin.

Messages (3)
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.
msg387337 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-02-19 17:39
Could it simply be that the link to mod:`termios` should have been to :manpage:`termios(3)` instead?
Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86568
2021-02-19 17:39:55iritkatrielsetnosy: + iritkatriel
messages: + msg387337
2020-11-19 08:02:21dan.merillatsetmessages: + msg381394
2020-11-19 07:54:10dan.merillatcreate