[Python-ideas] Why does sys.flags have both .interactive and .inspect?

Andrew Barnert abarnert at yahoo.com
Mon Aug 24 09:25:02 CEST 2015


On Aug 24, 2015, at 00:07, Alexander Walters <tritium-list at sdamon.com> wrote:
> 
>> On 8/23/2015 18:36, MRAB wrote:
>> I tested it, and they _can_ be different.
>> 
>> sys.flags.interactive will be true if you include the -i switch.
>> 
>> sys.flags.inspect will be true if you include the -i switch or set the PYTHONINSPECT environment
>> variable.
>> 
>> Thus, if you don't include the -i switch but _do_ set PYTHONINSPECT,  sys.flags.interactive will be
>> false and sys.flags.inspect will be true.
> 
> That seams significant enough to be documented.  I'll work on a patch in the morning.

Wouldn't it be better to write a more complete explanation of what "inspect" and "interactive" mean, so it's obvious that the one must imply the other but not vice-versa, instead of just saying that one implies the other and still leaving what they actually mean a mystery to anyone who doesn't read the C source?


More information about the Python-ideas mailing list