You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But you're right that the autofix here just makes things worse! I think we should just not emit RUF013 at all here. It's outside the scope of this rule to detect type annotations that are simply invalid, and definitely outside the scope of the rule to try to fix them.
A bare Optional would be Optional[Any], which is Any | None. Which isn't helpful, since Any already includes None. The ones that are allowed to be bare, like list -> list[Any], still make sense with Any.
Here is the bad code diff
Obviously, an untyped Optional is fine, and
Optional[Optional]
doesn't make much sense here as an autofix.The text was updated successfully, but these errors were encountered: