2 ms·
> Python: - Default argument is a stored value that will not be re-created on every call. PSA for anyone working with datetime variables!
by joshdavham 1y ago
> Python: - Default argument is a stored value that will not be re-created on every call.
PSA for anyone working with datetime variables!
- naet 1y agoI'm not regularly a python developer and I just spent a ton of time earlier this week tripped up by the default argument being a stored value. I was using to make an empty set if no set was passed in... but the set was not always empty because it was being reused. Took me forever to figure out what was going on.