Discussion about this post

User's avatar
Belze's avatar

That's why this is already included as a linter rule in ruff (originally from flake8-boolean-trap)

https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/

Also with useful hint of making the boolean argument keyword-only

Expand full comment
Tapan Anand's avatar

While its possible booleans in general in an API may be bad, but the example given here doesn't prove it. As soon as I read that there was a need to support new output type, it was obvious an enum is needed. Putting in a boolean there didn't make sense to me at all.

Expand full comment
17 more comments...

No posts