DBUtils icon indicating copy to clipboard operation
DBUtils copied to clipboard

Are Python boolean traps worth fixing?

Open cclauss opened this issue 2 years ago • 1 comments

% ruff --select=FBT --statistics .

93	FBT003	Boolean positional value in function call
12	FBT002	Boolean default value in function definition
  • https://beta.ruff.rs/docs/rules/#flake8-boolean-trap-fbt
  • https://adamj.eu/tech/2021/07/10/python-type-hints-how-to-avoid-the-boolean-trap/

My sense is that it breaks too much to fix them now but it is an interesting insight.

cclauss avatar Apr 29 '23 21:04 cclauss

The main problem here is that DBUtils does not support keyword-only parameters for the constructors of its classes.

This should be changed, but probably only in the next major version since this would break backward compatibility.

Cito avatar Apr 29 '23 23:04 Cito