Skip to content

Commit 69b6626

Browse files
authored
Modifies sentence and provides link to explanation of mutable defaults gotcha in the documentation (#1251)
Adds link to explanation of mutable default gotcha
1 parent 0a2b738 commit 69b6626

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ C(a=42, b=[], c=[], d={})
122122

123123
It's important that the decorated method -- or any other method or property! -- doesn't have the same name as the attribute, otherwise it would overwrite the attribute definition.
124124

125-
Please note that as with function and method signatures, `default=[]` will *not* do what you may think it might do:
125+
Similar to the [common gotcha with mutable default arguments](https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments), `default=[]` will *not* do what you may think it might do:
126126

127127
```{doctest}
128128
>>> @define

0 commit comments

Comments
 (0)