1 import sys
2
3 class dummy(object):
4 def __init__(self, val):
5 self.val = val
6
7 class myobj(object):
8 def __init__(self, resourc
You should change
def __init__(self, resources=[]):
self._resources = resources
to
def __init__(self, resources=None):
if resources is None:
resources = []
self._resources = resources
and all will be better. This is a detail in the way default arguments are handled if they're mutable. There's some more information in the discussion section of this page.