[Python-ideas] Show deprecation warnings in the interactive interpreter

Nick Coghlan ncoghlan at gmail.com
Wed Feb 25 23:34:31 CET 2015


On 26 February 2015 at 08:03, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Thu, 26 Feb 2015 07:35:17 +1000
> Nick Coghlan <ncoghlan at gmail.com> wrote:
>>
>> It may also be worthwhile introducing a "-Wmain" shorthand for
>> "-Wdefault:::__main__", as I could see that being quite useful to
>> system administrators, data analysts, et al, that want to know about
>> deprecation warnings in their own custom scripts, but don't really
>> care about deprecations in support libraries.
>
> -1. This is making the "main script" special while code factored out in
> another module won't benefit.
> Furthermore there hasn't been any demand for this.

Yes there has, at the Linux distro level. I just haven't escalated it
upstream because I didn't think there was anything useful we could do
about it given the previous decision to default to silencing
deprecation warnings by default outside testing frameworks.

The key problem with the status quo from my perspective is that
sysadmins currently don't get any warning that their scripts might
have problems when Fedora next upgrades to a new version of Python,
because they're not getting the deprecation warnings by default.

Given a -Wmain option upstream, I'd likely try to make the case for
that as the default behaviour of the distro system Python, but without
"enable all warnings for __main__" at least being a readily available
behaviour in the reference interpreter, it's arguably too much of a
divergence (since we'd be defining the new behaviour ourselves, rather
than selecting a different upstream behaviour as the default)

Regards,
Nick.

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


More information about the Python-ideas mailing list