summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2018-12-21 00:13:42 +0530
committerGitHub <noreply@github.com>2018-12-21 00:13:42 +0530
commitf03d941d86ed86496ad91e5b4617598e34e21c6b (patch)
tree0b612dd6eca77f3794095801466e6dcaf8672ea6
parent62926bd431868a0c8de3912b29d30dc11c196aee (diff)
parent7bdc3d8f2f256c4ab704226e392948cad2a0ff13 (diff)
Merge pull request #3424 from EvilKhaosKat/patch-1
[python3/en] A note about common gotcha with mutable defaults
-rw-r--r--python3.html.markdown1
1 files changed, 1 insertions, 0 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index 25f88943..1b8fa88e 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -808,6 +808,7 @@ class Superhero(Human):
# add additional class attributes:
self.fictional = True
self.movie = movie
+ # be aware of mutable default values, since defaults are shared
self.superpowers = superpowers
# The "super" function lets you access the parent class's methods