Message 306162 - Python tracker

Message306162

Author vstinner
Recipients Aaron.Meurer, Jim.Jewett, The Compiler, ezio.melotti, jayvdb, martin.panter, mbussonn, ncoghlan, njs, r.david.murray, rbcollins, serhiy.storchaka, takluyver, terry.reedy, vstinner
Date 2017-11-13.16:42:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510591330.03.0.213398074469.issue24294@psf.upfronthosting.co.za>
In-reply-to
Content
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@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
History
Date User Action Args
2017-11-13 16:42:10vstinnersetrecipients: + vstinner, terry.reedy, ncoghlan, rbcollins, ezio.melotti, r.david.murray, njs, Aaron.Meurer, takluyver, martin.panter, Jim.Jewett, serhiy.storchaka, The Compiler, jayvdb, mbussonn
2017-11-13 16:42:10vstinnersetmessageid: <1510591330.03.0.213398074469.issue24294@psf.upfronthosting.co.za>
2017-11-13 16:42:10vstinnerlinkissue24294 messages
2017-11-13 16:42:09vstinnercreate