-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow converter.optional to take a Converter such as converter.pipe a…
…s its argument (#1372) * Allow converter.optional to take a converter such as converter.pipe as its argument * Only turn optional into a Converter if needed * Move call to Converter constructor to the end of optional() The constructor consumes __annotations__, so move the constructor call to after those have been set on the optional_converter function * Update tests/test_converters.py * Update tests/test_converters.py --------- Co-authored-by: Hynek Schlawack <[email protected]>
- Loading branch information
1 parent
ee0f19b
commit e21793e
Showing
3 changed files
with
68 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 @@ | ||
`attrs.converters.optional()` works again when taking `attrs.converters.pipe()` or another Converter as its argument. |
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