kennethreitz/args — pull request #18 by Amper (2012-11-27 11:45:37+00:00)
Title: Fix: property "copy" returns no real copy

class ArgsList(object):
def __init__(self, args=None):
self._args = args or []
@property
def all(self):
return self._args
@property
def copy(self):
return ArgsList(self.all)

my_args = ArgsList([1,2,3,4,5])
tmp_args = my_args.copy
tmp_args.all[0] = 999

print(my_args.all) # [999, 2, 3, 4, 5] - OOPS!