たとえば関数をdef foo(x=[]): なんとかかんとか〜とデフォルト値付きで定義しているとき、xのデフォルト値は「毎回生成されるわけではない」ので、xに要素を追加すると次回xを与えずに呼んだ時のデフォルト値は変更された後の値になってしまっているというものが(確か)ある
デフォルト値は毎回生成されるわけではない例 https://wandbox.org/permlink/1VcYBAtEoeTe6J5J
Mastodon is the best way to keep up with what's happening.
Follow anyone across the fediverse and see it all in chronological order. No algorithms, ads, or clickbait in sight.