Re: [Python-Dev] PEP 561: Distributing and Packaging Type Information

2017年10月27日 02:47:12 -0700

On 2017年10月27日 11:31:04 +0200
Antoine Pitrou <[email protected]> wrote:
> On 2017年10月26日 15:42:19 -0700
> Ethan Smith <[email protected]> wrote:
> > Stub Only Packages
> > ''''''''''''''''''
> > 
> > For package maintainers wishing to ship stub files containing all of their
> > type information, it is prefered that the ``*.pyi`` stubs are alongside the
> > corresponding ``*.py`` files. However, the stubs may be put in a sub-folder
> > of the Python sources, with the same name the ``*.py`` files are in. For
> > example, the ``flyingcircus`` package would have its stubs in the folder
> > ``flyingcircus/flyingcircus/``. This path is chosen so that if stubs are
> > not found in ``flyingcircus/`` the type checker may treat the subdirectory 
> > as
> > a normal package. The normal resolution order of checking ``*.pyi`` before
> > ``*.py`` will be maintained. 
> 
> I am not sure I understand the rationale for this. What would be the
> problem with looking for the stubs in a directory named, e.g;
> "flyingcircus/__typing__"?
I just saw Nathaniel asked the same question above. Sorry for the
noise!
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to