[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

STINNER Victor report at bugs.python.org
Mon Nov 13 11:42:10 EST 2017


STINNER Victor <victor.stinner at gmail.com> added the comment:

If you consider that the REPL is designed for developers, I would also suggest to show ResourceWarning by default.

I'm not sure of that since I like to write crappy code of REPL (and I hope that nobody logs my keyboard)! Example:

haypo at selma$ python3
Python 3.6.2 (default, Oct  2 2017, 16:51:32) 
>>> open("/etc/issue").read()
'\\S\nKernel \\r on an \\m (\\l)\n\n'

I may be annoyed by a ResourceWarning warning here, since it's a oneliner written to be only run once. I know that my code is crappy, but I also know that it works well and it's much shorter to write than "with open(..) as fp: fp.read()" :-)

Yet another approach: I proposed to add a "developer mode", -X dev option:
https://mail.python.org/pipermail/python-dev/2017-November/150514.html

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24294>
_______________________________________


More information about the Python-bugs-list mailing list