|
|
|
|
|
by tempcommenttt
739 days ago
|
|
This is error is one that most Python programmers must have experienced early in their career. Usually the other way around, when they define a mutable default value and are hit by strange results. On when adding the current time (datetime.datetime.now()) as a function default. As a rookie programmer you might not notice this pattern, but after getting hit a few times you’ll immediately see that. And default to either a factory or to None and then set the value inside the function. ChatGPT code is only safe to use if you understand it. If you don’t, there’s always the risk that it will bite you. |
|