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

Nathaniel Smith njs at pobox.com
Thu May 28 11:04:05 CEST 2015


On Thu, May 28, 2015 at 1:53 AM, Jonathan Slenders <jonathan at slenders.be> wrote:
> +1 on this too.
>
> I'm author of the "ptpython" REPL.
>
> Nathaniel Smith: could you tell me what I should do?
>
> Is it enough when I make sure that all code runs in __main__ and running
> this command at the start?
> warnings.filterwarnings("default", category=DeprecationWarning,
> module="__main__")

That should do it, yes.

-- 
Nathaniel J. Smith -- http://vorpus.org


More information about the Python-ideas mailing list