Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.44.0' into master
- Loading branch information
Showing
14 changed files
with
4,201 additions
and
4,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. _provider-typing: | ||
|
||
Typing and mypy | ||
=============== | ||
|
||
.. meta:: | ||
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Providers,Typing,Mypy, | ||
Pattern,Example | ||
:description: Dependency Injector providers are mypy-friendly. Providers module goes with the | ||
typing stubs to provide the typing information to ``mypy``, IDEs and editors. | ||
|
||
Providers are ``mypy``-friendly. | ||
|
||
Providers module goes with the typing stubs. It provides typing information to ``mypy`` and your | ||
IDE. | ||
|
||
.. code-block:: python | ||
from dependency_injector import providers | ||
class Animal: | ||
... | ||
class Cat(Animal) | ||
... | ||
provider = providers.Factory(Cat) | ||
if __name__ == '__main__': | ||
animal = provider() # mypy knows that animal is of type "Cat" | ||
You can use ``Provider`` as a generic type. This helps when a provider is an argument of a | ||
function or method. | ||
|
||
.. code-block:: python | ||
:emphasize-lines: 12 | ||
from dependency_injector import providers | ||
class Animal: | ||
... | ||
class Cat(Animal) | ||
... | ||
provider: providers.Provider[Animal] = providers.Factory(Cat) | ||
if __name__ == '__main__': | ||
animal = provider() # mypy knows that animal is of type "Animal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
"""Top-level package.""" | ||
|
||
__version__ = '3.43.1' | ||
__version__ = '3.44.0' | ||
"""Version number. | ||
:type: str | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.