<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 5, 2017 at 9:59 AM, Victor Stinner <span dir="ltr"><<a href="mailto:victor.stinner@gmail.com" target="_blank">victor.stinner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2017-12-05 16:50 GMT+01:00 Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>>:<br>
> Honestly, I didn't completely follow what Victor thinks of the PEP -- his<br>
> post seemed mostly about promoting his own -X dev flag.<br>
<br>
</span>-X dev is similar (but different) than -W default: show warnings which<br>
are hidden by default otherwise. -W default works on Python 2.7 and<br>
3.6.<br>
<span class=""><br>
> I have nothing<br>
> against that flag but I don't see how its existence is relevant to the PEP,<br>
> which is about giving users who don't even know they are Python developers a<br>
> hint when they are using deprecated features (for which there always must be<br>
> a shiny new replacement!).<br>
<br>
</span>I disagree that *users* of an application is supposed to "handle"<br>
deprecation warnings: report them to the developer, or even try to fix<br>
them. IHMO these warnings (hidden by default) were introduced for<br>
developers of the application.<br></blockquote><div><br></div><div>But the whole point of the PEP is that it only warns about deprecations in code over which the user has control -- likely __main__ is their own code, and they *can* handle it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My point is that I prefer to keep the status quo: continue to hide<br>
deprecation warnings, but promote existing solutions like -W default<br>
to display these warnings, teach to developers how to see and fix<br>
these warnings.<br></blockquote><div><br></div><div>If they import a 3rd party module which does something deprecated, the user won't see any deprecation warnings.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Even for developers, I'm not sure that only showing warnings in<br>
__main__ is useful, since more and more application use a __main__<br>
module which is a thin entry point : import + function call (ex: "from<br>
app import main; main()").<span class=""><br></span></blockquote><div><br></div><div>And that's intentional -- such developers are supposed to actively test their code, and deprecations will be shown to them by the unittest framework. Having a minimal __main__ implies that their users won't see any deprecation warnings.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> Therefore I am planning to accept it by the end of this week unless more objections are voiced.<br>
<br>
</span>It's ok if we disagree. I just wanted to share my opinion on this issue ;-)<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">I just worry that your opinion might be based on a misunderstanding of the proposal. If we agree on what the PEP actually proposed to change, and how that will affect different categories of users and developers, I am okay with disagreement.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>