<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 12, 2017 at 8:07 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Sun, Nov 12, 2017 at 11:21 AM, Ethan Smith <<a href="mailto:ethan@ethanhs.me">ethan@ethanhs.me</a>> wrote:<br>
><br>
><br>
> On Sun, Nov 12, 2017 at 9:53 AM, Jelle Zijlstra <<a href="mailto:jelle.zijlstra@gmail.com">jelle.zijlstra@gmail.com</a>><br>
> wrote:<br>
>><br>
>> 2017-11-12 3:40 GMT-08:00 Ethan Smith <<a href="mailto:ethan@ethanhs.me">ethan@ethanhs.me</a>>:<br>
</span><span class="gmail-">>>> The name of the stub<br>
>>> package<br>
>>> MUST follow the scheme ``pkg_stubs`` for type stubs for the package named<br>
>>> ``pkg``. The normal resolution order of checking ``*.pyi`` before<br>
>>> ``*.py``<br>
>>> will be maintained.<br>
>><br>
>> This is very minor, but what do you think of using "pkg-stubs" instead of<br>
>> "pkg_stubs" (using a hyphen rather than an underscore)? This would make the<br>
>> name illegal to import as a normal Python package, which makes it clear that<br>
>> it's not a normal package. Also, there could be real packages named<br>
>> "_stubs".<br>
><br>
> I suppose this makes sense. I checked PyPI and as of a few weeks ago there<br>
> were no packages with the name pattern, but I like the idea of making it<br>
> explicitly non-runtime importable. I cannot think of any reason not to do<br>
> it, and the avoidance of confusion about the package being importable is a<br>
> benefit. I will make the change with my next round of edits.<br>
<br>
</span>PyPI doesn't distinguish between the names 'foo-stubs' and 'foo_stubs'<br>
-- they get normalized together. So even if you use 'foo-stubs' as the<br>
directory name on sys.path to avoid collisions at import time, it<br>
still won't allow someone to distribute a separate 'foo_stubs' package<br>
on PyPI.<br>
<br>
If you do go with a fixed naming convention like this, the PEP should<br>
probably also instruct the PyPI maintainers that whoever owns 'foo'<br>
automatically has the right to control the name 'foo-stubs' as well.<br>
Or maybe some tweak to PEP 541 is needed.<br></blockquote><div><br></div><div>As I understand it however, the distribution name need not map to to the
 package name in any way. So regardless of if foo-stubs is seen as 
foo_stubs, I could name the distribution Albatross if I wished, and 
install the foo-stubs package into site/dist-packages, and it would work. Also I'm not sure if the PyPI change would require an edict from a PEP, but if so, I wouldn't be opposed to the idea, I think it would be nice to default the stub packages to the owners of the normal packages (people should, to my understanding, be able to make alternate distributions without hassle).</div><div><br></div><div>Ethan<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-HOEnZb"><font color="#888888"><br>
-n<br>
<br>
--<br>
Nathaniel J. Smith -- <a href="https://vorpus.org" rel="noreferrer" target="_blank">https://vorpus.org</a><br>
</font></span></blockquote></div><br></div></div>