Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2.1. In this PR you'll find the infrastructure layer that encapsulates all the shared logic for the whole application and make it linear from modules importing perspective (now, there is no imports on the same level)
if TYPE_CHECKING:
lines are removed due to it's unnecessary. Basically this line might be useful if you have some architecture issues (circular imports) in your code but seems there is no reason to overcomplicate the project with additionalif
statement in all concrete implementations. Even thought if we decide having them in the project I would recommend usingfrom __future__ import annotations
over theif TYPE_CHECKING:
__all__
. Since the__all__
could be used to control wild imports in Python this is definitely a good way to go with in my opinion. In the old version of the code the controll of the import is on the__init__.py
which make developers to think about a couple of places to export their modules. With current approach you control your concrete SSO implementation in your single file which make the code more robust from changes perspective. Like, all the names that are allowed to be imported from this module are defined in this module itself. And, the way to import this module is defined on the level above (on the package level).So basically this is the result of the typings improvements: