On Thu, Feb 2, 2017 at 12:24 PM, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: >>>> etc, etc, etc, etc. It's >>>> not a proxy for "being piped" - it's that when your output isn't going >>>> to a terminal, asking "what is my terminal size" isn't particularly >>>> productive. >>> >>> Then explain why os.get_terminal_size() returns the correct answer. > > No answer Chris? > > You've spent a lot of time telling me that asking for the terminal size > doesn't even make sense for the exact circumstances where > os.get_terminal_size() not only returns a size, but the *correct* size. >
Because you've already decided in your own mind that one answer is THE correct one, and nothing I say will possibly change that. In my very first post on this subject, I pointed out that shutil and os were returning *different* answers, *both* of which are useful. You persist in insisting that only one of them is useful and correct, and so there's no point responding. Let me redirect this discussion slightly. How do you calculate the square root of a number? >>> (-1) ** 0.5 (6.123233995736766e-17+1j) >>> math.sqrt(-1) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: math domain error >>> cmath.sqrt(-1) 1j Why does only one of these give the correct answer? If you absolutely INSIST that one is correct, how can anyone argue as to why the others exist? Or is it possible that there are times when you want ValueError and times when you want a complex result? ChrisA -- https://mail.python.org/mailman/listinfo/python-list