The rule boolean-type-hint-positional-argument (FBT001) was extended in #7501 , under preview, to also flag positional arguments that have a type hint with any union of types that includes bool.
The intent of the rules is specifically to find places where a boolean is used as a (binary) flag, in a positional argument. If an argument has a type hint of bool or even bool | None, it makes sense to predict that the argument is being used as a flag. But the preview behavior allows any union, even, say bool | str | MyClass. This seems like a situation where it's a bit of a stretch to assume that the user is using the boolean as a flag.
Maybe the concern is unfounded and this doesn't actually happen in the real world, but I figured the community could weigh in a bit on the point before stabilizing this preview behavior.
The rule boolean-type-hint-positional-argument (FBT001) was extended in #7501 , under preview, to also flag positional arguments that have a type hint with any union of types that includes
bool.The intent of the rules is specifically to find places where a boolean is used as a (binary) flag, in a positional argument. If an argument has a type hint of
boolor evenbool | None, it makes sense to predict that the argument is being used as a flag. But the preview behavior allows any union, even, saybool | str | MyClass. This seems like a situation where it's a bit of a stretch to assume that the user is using the boolean as a flag.Maybe the concern is unfounded and this doesn't actually happen in the real world, but I figured the community could weigh in a bit on the point before stabilizing this preview behavior.