forked from python-attrs/attrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer type annotations from converters (python-attrs#710)
* Infer annotations from converters * Use semantic newlines * Add 787.change.rst * Don't let type annotations override converters * Make pipe() infer type annotations * Use PY2 instead of sys.versioninfo >= (3, 3) * Avert crashing with a nullary converter * Small doc change * Add type inference for optional() * Make pipe() annotations actually work Co-authored-by: Hynek Schlawack <[email protected]>
- Loading branch information
Showing
5 changed files
with
280 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
If present, type annotations of the ``converter`` argument to ``attr.ib`` are now used to give type annotations to ``__init__``. | ||
``attr.converters.pipe`` and ``attr.converters.optional`` also infer type annotations based on the passed converters. |
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