I just hit this.
I suggest that assert is never used without a second arg which explains the failed assertion. There are code quality tools which can enforce this. If you want these assertions to cause issues to be raised, it helps to have assertion messages let people raise bugs which can be used to identify the problem.
Since this component is py36+, it could also use should_be instead of assert, which auto-voodoo creates useful assertion error messages.
And as usual, I would prefer these are warnings. In my case it is a custom lazy-ily defined serializer and it could be safely ignored as inspecting it wont work anyway. The following worked for me.
- assert is_serializer(serializer)
+ if not is_serializer(serializer):
+ return
Originally posted by @jayvdb in #120 (comment)
I just hit this.
I suggest that assert is never used without a second arg which explains the failed assertion. There are code quality tools which can enforce this. If you want these assertions to cause issues to be raised, it helps to have assertion messages let people raise bugs which can be used to identify the problem.
Since this component is py36+, it could also use
should_beinstead ofassert, which auto-voodoo creates useful assertion error messages.And as usual, I would prefer these are warnings. In my case it is a custom lazy-ily defined serializer and it could be safely ignored as inspecting it wont work anyway. The following worked for me.
Originally posted by @jayvdb in #120 (comment)