Make attrs work with a converter instance that does not evaluate True. Other code spots already do an explicit comparison to None, so do that here as well. Failing to do so on a valid converter instance that is a valid callable but has a __bool__() that evaluates to False ends up trying to call _fmt_converter_call on that callable rather than on the Converter instance created from it.
Pull Request Check List
[x] Do not open pull requests from your main branch – use a separate branch!
There's a ton of footguns waiting if you don't heed this warning. You can still go back to your project, create a branch from your main branch, push it, and open the pull request from the new branch.
This is not a pre-requisite for your pull request to be accepted, but you have been warned.
[x] Added tests for changed code.
Our CI fails if coverage is not 100%.
Summary
Make attrs work with a converter instance that does not evaluate True. Other code spots already do an explicit comparison to None, so do that here as well. Failing to do so on a valid converter instance that is a valid callable but has a
__bool__()
that evaluates to False ends up trying to call_fmt_converter_call
on that callable rather than on the Converter instance created from it.Pull Request Check List
main
branch – use a separate branch!.pyi
)..rst
and.md
files is written using semantic newlines.changelog.d
.