Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171107/69457a0c/attachment.html below:
<div dir="ltr">OK, so let's come up with a set of heuristics that does the right thing for those cases specifically. I'd say whenever you're executing code from a zipfile or some such it's not considered your own code (by default).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 2:16 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@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="">On 8 November 2017 at 06:32, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
> On Mon, Nov 6, 2017 at 7:23 PM, Terry Reedy <<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>> wrote:<br>
>><br>
>> On 11/6/2017 9:47 PM, Nick Coghlan wrote:<br>
>> [...]<br>
>>><br>
>>> - "only show me legacy calls in *my* code" (the "I trust my deps to<br>
>>> take care of themselves" use case)<br>
>><br>
>><br>
>> Perhaps this should be the new default, where 'my code' means everything<br>
>> under the directory containing the startup file. If an app developer either<br>
>> fixes or suppresses warnings from app code when they first appear, then<br>
>> users will seldom or never see warnings. So for users, this would then be<br>
>> close to the current default.<br>
><br>
> Yes, this or a close a variant sounds like a decent option.<br>
<br>
</span>Unfortunately, there are a lot of common directory layouts where a<br>
simple filesystem based assumption like that one will lead to warnings<br>
from third party code:<br>
<br>
1. zipapp archives, where everything, including __main__.py, shares a<br>
common path prefix (the zip archive)<br>
2. Working directories that include a ".venv" link to the default<br>
virtual environment for a project (this is a not uncommon way of<br>
telling IDEs which venv to use)<br>
3. Package execution, when the package includes a "_vendor" or "_bundle" subtree<br>
<br>
The one thing we can be reasonably confident counts as "the<br>
developer's code" is "__main__", but even that isn't completely<br>
certain in cases where folks are publishing single file scripts for<br>
use by others (e.g. a DeprecationWarning from get-pip.py would be<br>
useful to pip developers, but almost entirely unhelpful to users of<br>
the script itself).<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan  |  <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>  |  Brisbane, Australia<br>
</div></div></blockquote></div><br><br clear="all"><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>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4