-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expand importlib #183
expand importlib #183
Conversation
@brettcannon Do you think it makes sense to add all these submodules and internal classes? How much of this is considered a stable/documented API? I think stuff that's not part of the stable API should be left out of the stubs -- it's just asking for problems when the internals get updated in a future version but the stub is behind. |
Don't include most of that. :) The vast majority of it is private and even that which isn't is exposed through other modules as part of the public API (e.g. If you want stubs for importlib then feel free to open an issue for it and assign it to me and I will hand-write appropriate type hints. |
OK, created #189, closing this one. |
ok, I'll try to avoid submitting too much internal. |
For _ modules specifically, if you look at typeshed it's actually quite
common to have stubs for these. I'm not sure actually why those are there
-- it could be that people just found they were needed by stubgen. I'm not
excited by their presence and if you can io without referencing _io I'd be
happier. OTOH looking in _io.pyi it seems that most of the APIs it defines
are actually public (read(), write() etc.) so I think it's okay to keep the
current structure and just add signature types.
|
So should the type stubs match where the code is defined (e.g. |
I'm not 100% sure I understand your question. :-( Answering the most likely interpretation, in cases where we decide not to completely hide the private |
OK, concrete example: So my question is do you want the type hints written for |
In that case it sounds fine to leave |
improve importlib.
based on stubgen mainly.