Skip to content
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

Consider splitting __init__.pyi into several files #6

Open
rth opened this issue Apr 10, 2023 · 2 comments
Open

Consider splitting __init__.pyi into several files #6

rth opened this issue Apr 10, 2023 · 2 comments

Comments

@rth
Copy link
Member

rth commented Apr 10, 2023

Right now __init__.pyi is 14k lines of code which is massive, and doesn't even load in GitHub properly for me.

If possible it could be good to split it into submodules (all of which are imported from __init__.pyi). PEP 561 doesn't say anything about it, but in practice for instance the typeshed package does this so it probably works fine. Though there might be something about using from a import b as b for it to work.

@simonegiacomelli
Copy link
Collaborator

I agree on principle. Do you have other use cases for this feature (beside opening the file in GitHub)?
I searched about this topic and found that there are files of 60 megabytes of pyi.

The principal consumer of these files are usually the IDE and the people that generates the stubs to manually check on them (the huge mentioned files are generated, luckily for them :)
I believe that the typeshed stubs are in that shapes because stubgen (the tool used to generate those stubs) mimics the source package organisation (it's my current best guess).

@rth
Copy link
Member Author

rth commented Apr 12, 2023

No strong opinion, it was just a though. Not having one huge file would probably just make it easier overall to work with it (reviewing diffs, understanding what are the links between objects without scrolling forever etc).

But clearly, it's not critical now, so also feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants