0
class Note:
nextseqNum = 0
def __init__(self):
self.text = str
self.dateCreated = datetime
self.dateRead = datetime
self.description = str
self.category = str
self.priority = int
self.hidden = bool
self.seqNum = nextseqNum
nextseqNum += 1
出於某種原因,它是扔我類變量不工作的原因? Python的
UnboundLocalError: local variable 'nextseqNum' referenced before assignment
我不明白爲什麼。那你是如何讓共享類變得容易的?
工作感謝你! – 2014-10-01 23:51:23