I'm relatively new to python and I've run into this problem. DECLARING CLASS class structure: def __init__(self, folders = []): self.folders = folders def add_folder(self, folder): self.folders.append(tuple(folder)) Now I try to make an instance of this class structure1 = structure() structure1.add_folder([('foo'),]) print structure1.folders This returns: [('foo',)] This works fine. But when I try to make another instance of that class... structure2 = structure() print structure2.folders This now also returns: [('foo',)] Even though I haven't added any folders to this new instance What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20050921/6409d467/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4