Serhiy Storchaka <storchaka@...> writes:
> 1. It is preferable to pass boolean arguments as keyword arguments (if
> this is not the only argument).
>
> 2. It is preferable to declare boolean parameters as keyword-only
> parameters.
>
It is true for literal keywords arguments, but passing a named variable with
a boolean value can be fine.
# Bad
my_func(True)
# Good
my_func(enable=True)
# Good
enable=True
my_func(enable)
# Meh
enable=True
my_func(enable=enable)
# Bad
w=True
my_func(w)