Skip to content

Mutable default argument #2

@bogdan-kulynych

Description

@bogdan-kulynych

receive_scans takes a mutable default argument beacons. Any changes to mutable default arguments persist, thus might result in unintended side-effects. See more here. receive_scans does not mutate the beacons list, but the problem can appear due to code of a user of the class.

Additionally, now == None comparison is not recommended. However, this could cause a problem only if now variable is of custom class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions