[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is not a bug, see http://docs.python.org/dev/faq/design.html#why-are-default-values-shared-between-objects -- nosy: +pitrou resolution: -> invalid stage: -> committed/rejected ___ Python tracker

[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Matthew Walker
Changes by Matthew Walker : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Matthew Walker
New submission from Matthew Walker : When initializing a class with an empty dict() object as a default initializer, if it is not overridden, multiple instances of the class will share the dictionary. IE: class test(object): def __init__(self, obj=dict()): self.obj = obj a = test() b =