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.
receive_scans
takes a mutable default argumentbeacons
. Any changes to mutable default arguments persist, thus might result in unintended side-effects. See more here.receive_scans
does not mutate thebeacons
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 ifnow
variable is of custom class.