Skip to content

Support an allowlist of function calls in argument defaults for B008 #3762

@rouge8

Description

@rouge8

It would be great if B008 supported an allowlist of function calls, similar to extend-immutable-calls for B006. We do a lot of this in our code which as far as I know has no subtle bugs:

def f(x=Decimal("1000")):
    pass

Or maybe it's worth hardcoding Decimal as an exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationgood first issueGood for newcomersruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions