[issue13609] Add "os.get_terminal_size()" function

Antoine Pitrou report at bugs.python.org
Sat Jan 21 23:47:27 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> +1. I also find weird that a function, especially one living in the os
> module, has such a high level of abstraction (basically this is why I
> was originally proposing shutil module for this to go in).
> 
> Given the different opinions about the API, I think it's best to
> expose the lowest level functionality as-is, and let the user decide
> what to do (read env vars first, suppress the exception, use a
> fallback, etc.). 

Fair enough, but other people expressed sympathy for the two-function
approach :) I'm personally indifferent, although I find
"get_terminal_size_raw" a bit ugly and liked "query_terminal_size"
better.

(and looking up ROWS and COLUMNS make sense, since they are de facto
standards)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13609>
_______________________________________


More information about the Python-bugs-list mailing list