On Wed, Oct 26, 2016 at 3:16 PM, Cody Piersall
On Wed, Oct 26, 2016 at 4:48 PM, Paul Moore
wrote: Good point. We could, of course, detect when stdin is non-interactive, but at that point the code is starting to get unreasonably complex, as well as having way too many special cases. So I agree, that probably kills the proposal.
Isn't that check really just an isatty() check? Or is that not reliable enough for some reason? Here's some code that performs that check, and works on Linux and Windows:
It might or might not be an isatty() check (it's actually a bit more complicated, there's -i and various other things to take into account), but it hardly matters -- Python already has well-defined logic for deciding whether it should launch an interactive REPL or not. If we were going to do this, we'd keep that logic in place while swapping out the actual start_a_REPL() call with something else. There might be showstoppers here but I don't think this is one of them :-) -n -- Nathaniel J. Smith -- https://vorpus.org