[Python-ideas] Displaying DeprecationWarnings in the interactive interpreter, second try

Nick Coghlan ncoghlan at gmail.com
Thu May 28 08:46:12 CEST 2015


On 28 May 2015 at 15:04, Ben Finney <ben+python at benfinney.id.au> wrote:
> Nick Coghlan <ncoghlan at gmail.com> writes:
>
>> In addition to better alerting end users to genuinely imminent
>> deprecations that they should adapt to ASAP, splitting them again in
>> the interactive REPL case would restore a meaningful behavioural
>> difference that can help pragmatically guide decisions as to which is
>> more appropriate to use for a given deprecation:
>>
>> Test frameworks: both visible by default
>> Interactive REPL: DW visible by default, PDW hidden by default
>> Non-interactive execution: both hidden by default
>
> Is there already a clear API for a “test framework” or “interactive
> REPL” to declare itself as such?
>
> Do all the test frameworks and interactive REPL implementations already
> follow that API?

It's a convention. unittest sets the convention for test frameworks
(and, as far as I am aware, other popular test runners like nose and
py.test abide by it), while the default REPL, the code module, IDLE
and IPython will set the convention for REPLs (assuming we change it
away from matching the non-interactive default behaviour)

> I ask this to know whether your proposal entails that each
> implementation of a test framework or REPL will likely behave
> differently from other implementations in how it fits into the above
> categories.

Test frameworks and REPLs that don't adjust the warning filters on
startup will continue to default to the non-interactive behaviour.
Nobody is proposing to change that.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list