[Python-ideas] Show deprecation warnings in the interactive interpreter (original) (raw)

Chris Angelico rosuav at gmail.com
Wed Feb 25 23:49:38 CET 2015


On Thu, Feb 26, 2015 at 9:44 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

The focus on sysadmins sounds a bit gratuitous here. Furthermore I don't see why sysadmins would only use "main scripts" and not factor out their code. Besides, we don't want to add an option which would discourage factoring out code.

Another reason why this may be counter-productive: if you run your script through a stub, then the warnings disappear again.

If drawing the line at main is a problem, is it possible to enable warnings for "everything that came from the first entry in sys.path"? Or, if it helps, disable warnings for a specific set of paths? That way, you could factor out code into a local module (imported from the main module's directory) and still have warnings, but not have them for the stuff that you consider to be library modules.

ChrisA



More information about the Python-ideas mailing list