I've just started learning python and have recently encountered a problem while learning about classes. please have a look at the code.
class Critter(object):
"""your very own bug generator"""
total=0
def status(x):
print Critter.total
status=staticmethod(status)
def __init__(self,name):
print'a critter has been created'
self.name=name
Critter.total+=1
crit1=Critter('pooch')
crit2=Critter('Duff')
crit3=Critter('pluto')
Critter.status()
print'\nAccessing the class attributes through an object:',crit1.total
upon running the code I get this error:
line 19, in <module>
Critter.status(Critter.total)
TypeError: unbound method status() must be called with Critter instance as first
argument(got int instance instead)
I'm still unclear about how bound/unbound works. Sorry for the beginner question, any help given would be greatly appreciated.