-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
WPS412: Improve rationale #1781
Comments
The main idea is that I should not tweak your imports in your project. And with libraries it is totally fine to tweak imports. Libraries are going to use
Well, this is a hard topic. And it really depends. I use this style for almost all my libraries. But, I can imagine libs where this design is not suitable (like |
Yes, but the rationale sounds like it skips this check due to backwards-compatibility concerns, suggesting that you would still rather enforce it if it was a new library. So, it sounds to me like it should be reasonable to allow this, as long as the module is designed such that all external imports are meant to use the parent namespace, and not use any submodules. e.g. The asyncio example I've shown, appears to use a bunch of submodules to help keep the internal code maintainable, but developers should always |
I bring this up because I have a module |
I'm still not understanding the rationale for this violation, and was just wondering if you could explain it to me better.
Is it not standard practice (and Pythonic) to have a library which can be imported and used like:
This requires some logic, even it's only import statements. Are you proposing that this would be a better design?
The first approach looks better to me, but contradicts this rule. I'm just trying to understand the reasoning for this.
The text was updated successfully, but these errors were encountered: