DP-3T / reference_implementation

Apache License 2.0
127 stars 44 forks source link

Mutable default argument #2

Closed bogdan-kulynych closed 4 years ago

bogdan-kulynych commented 4 years ago

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.