Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Introduce new, Python 3-only way to declare things to inject
This pattern makes it more obvious where do we actually expect parameters to be injected and where do we expect them to be passed the regular way (Injector(use_annotations=True) nas a semi-global meaning while @Inject still covers only a single function).
- Loading branch information
Jakub Stasiak
committed
Oct 18, 2016
1 parent
7af3604
commit a1a9164539cfaf880612993d79298d73a8abd09f
Showing
7 changed files
with
213 additions
and
81 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
@@ -17,8 +17,8 @@ Example code: | ||
.. code-block:: python | ||
class X(object): | ||
@inject(s=str) | ||
def __init__(self, s): | ||
@inject | ||
def __init__(self, s: str): | ||
self.s = s | ||
def configure(binder): | ||
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
Oops, something went wrong.