Рассмотрим этот фрагмент кода и задаемся вопросом, можно ли вернуть значение до его обновления.
class A:
def __init__(self):
self.n = 0
def get_next(self):
return self.n++ # Return its current value. after it gets returned, update n.
a = A()
a.get_next() # return 0
a.get_next() # return 1