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
Move pathlib implementation out of __init__.py
#118582
Conversation
Using the `asyncio` package as a model.
@eryksun you mentioned renaming
... because that would speed up the import of |
Great if that really helps with performance. My issue was more trivial. I like to have easily recognizable names on tabs in my IDE. "_pathlib_abc.py" is a name that I can recognize in an instant without having to hover or use the document viewer. |
Hm. If I thumb through the standard library, there are quite a few submodules with generic basenames: |
No, not on tabs, and I wouldn't want qualified names on tabs. That's what the tree view of the documents viewer is for if I really need it. I know the standard library doesn't generally use easily recognizable module names in packages. That's why I qualified the asyncio example for what I personally prefer, and only for generic private names. Some names are easy for me to remember in context, such as "pool.py" in multiprocessing. It's just generic private names such as "_constants.py" that I wish had better names, since they aren't meant to be used in the public API anyway. But really almost anything is better than staring at a bunch of tabs labeled "__init__.py". |
Well, the |
Use the `__init__.py` file only for imports that define the API, following the example of asyncio.
Use the
__init__.py
file only for imports that define the API, following the example ofasyncio
.See https://discuss.python.org/t/make-pathlib-extensible/3428/172