It is not possible to do what you are trying to do here since integers are immutable in Python. Once they are created they cannot be changed.
From Python Documentation
The value of some objects can change. Objects whose value can change are said to be mutable; objects whose value is unchangeable once they are created are called immutable. ... An object’s mutability is determined by its type; for instance, numbers, strings and tuples are immutable, while dictionaries and lists are mutable.
Depending on what you are going to use this for what you could do instead is the following:
class Counter(object): # new style object definition.
def __init__( self, num ):
self.value = num
# this is 32bit int max as well, same as pow(2,32) function.
self.maximum = 0xFFFFFFFF
def increase(self):
self.value += 1
if self.value > self.maximum:
self.value -= self.maximum
def __repr__( self ): # representation function.
return str(self.value)
def __str__( self ): # string function
return str(self.value)
counter = Counter(10)
print counter
counter.increase()
print counter
counter.increase()
print counter