You aren't showing your complete class. It looks like you may have accidentally made something global that should have been local to your auction list.
Here's how I would create a class based on your specs. Does your code look something like this?
class AuctionList(object):
def __init__(self):
self.mylist = []
def AddToList(self, obj)
self.mylist.append(obj)
The way all of your code is aligned in your sample implies that your data is not indented to match the class it belongs to. I'm sure you know this already, but indentation is significant and required in Python. Take another look at it and see if that's what's messing up your code.
IsharaComix
Junior Poster in Training
98 posts since Feb 2010
Reputation Points: 109
Solved Threads: 23
Skill Endorsements: 0
Ah... OK. Do you see how you declare AuctionData and AuctionList in lines 7 and 8? Those are not aligned with the init function and are not referenced using 'self', so instead of becoming part of an instance of an AuctionList, they are just like static variables belonging to the entire AuctionList class (this is probably very different from other languages you've probably used).
Define your __init__ like this:
def __init__(self):
self.auctionData = []
self.auctionList = []
self.Clear_Auction_List()
This sets them as local variables, and it should behave properly.
IsharaComix
Junior Poster in Training
98 posts since Feb 2010
Reputation Points: 109
Solved Threads: 23
Skill Endorsements: 0
Question Answered as of 3 Years Ago by
IsharaComix