Commit Graph

1 Commits

Author SHA1 Message Date
Filipe Brandenburger e21793e90a
Allow converter.optional to take a Converter such as converter.pipe as 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 <hs@ox.cx>
2024-11-17 11:15:26 +00:00