Skip to content

Python: FP in py/modification-of-default-value when modification is guarded by check of value #1143

Closed
@s0

Description

@s0

As reported here: https://discuss.lgtm.com/t/false-positive-for-default-value-causing-early-return/1923

In this example: https://lgtm.com/projects/g/sympy/sympy/snapshot/190c7facbe879630c849b79962159f6b37459048/files/sympy/codegen/array_utils.py?sort=name&dir=ASC&mode=heatmap the mutation only occurs when a condition is met that is never true for the default value. As the default value is [], not [] will always be true when no parameter is passed in, so the default value will never me modified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions