I have definition like this:
class Task():
last_id = 0
def __init__(self, note, priority, tags=' '):
Task.last_id += 1
self.id = Task.last_id
I use the variable to number tasks in my program. The 1st task will be number 1, the 2nd, number 2, etc. However, if I create 2 tasks, then stop the program and restart the program, the 1st task I create is given the number 3 instead of 1. I can't figure out how to fix this. If I kill Pythonista, I always get the correct numbers, but it is a pain to kill Pythonista between runs.