[Python-ideas] Show deprecation warnings in the interactive interpreter

Terry Reedy tjreedy at udel.edu
Wed Feb 25 22:45:41 CET 2015


On 2/25/2015 3:39 AM, Ben Finney wrote:
> Serhiy Storchaka <storchaka at gmail.com>
> writes:
>
>> What you are think about turning deprecation warnings on by default in
>> the interactive interpreter?

I don't really get the point.  It seems to me that the idea is to have 
warnings optionally on during development, always off during production. 
  Most development, especially of 'permanent' code, does not take place 
at the interactive prompt.

> In its favour: Exposing problems early, when they can easily be fixed,
> is good.

I think the idea of turning warnings on and off would better work as an 
Idle option for the user process that executes user code.  The option 
would take effect the next time the user process is restarted, which is 
every time code is run from the editor, or when selected by the user.

> To its detriment: Making the interactive interpreter behave differently
> by default from the non-interactive interpreter should be resisted; code
> which behaves a certain way by default in one should behave the same way
> in the other, without extremely compelling justification.

An Idle option would apply to both code run from the editor and code 
entered at the Shell prompt.  Other IDEs could do the same.

I presume Warnings are issued on stderr.  If so, Idle would give them 
the stderr color, making them less confused with the differently colored 
program stdout output.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list