I have a class and a function that tries to update and return instances of this class:
class Foo:
def __init__(self):
self.datum = 'a'
def update(self):
self.datum = 'b' if self.datum == 'a' else 'a'
def updater(foo_obj):
return( foo_obj.update() )
but calling updater() returns Nones and not instances of class Foo. Why is this? What can I change to get the desired result?
type(updater(Foo())) #NoneType
Foo.update.