-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Example
def a(b=float("inf")): ... # True Negative
def c(d=slice(None)): ... # False Positive, as slice() is immutableThere is also the semi-related corner case of def e(f: slice = dict()): .... This is clearly erroneous code, but it is incorrectly flagged as violating B008, despite the docs saying "Parameters with immutable type annotations will be ignored by this rule". (e.g., def g(h: int = dict()): ..., does not trigger B008)
see also: docs.python.org > builtins > slice
Version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working