commit | 5428b828a8c41afe95a03c1c683e7cf0edcc172c | [log] [tgz] |
---|---|---|
author | martin f. krafft <madduck@madduck.net> | Sat Jul 06 20:50:26 2013 +0200 |
committer | martin f. krafft <madduck@madduck.net> | Sun Jul 07 09:01:06 2013 +0200 |
tree | 833e996b0760def97f03ecf23f99acaa2c332124 | |
parent | 7deb3d299876812cd3ca03ccd7bdb141b9c4fa57 [diff] |
Do not use constructors in default arguments Something like __init__(self, classes=Classes(), …) causes Python to create a single Classes instance that gets used as default argument subsequently. If something changes the variable then referenced by classes, subsequent calls to the default constructor will cause the changed object to be referenced. Signed-off-by: martin f. krafft <madduck@madduck.net>