I know class foo(object) is an old school way of defining a class. But I would like to understand in more detail the difference between these two.
class foo(object)
class foo(object): is the 'new' way of declaring classes.
class foo(object):
This change was made in python 2.2, see this PEP for an explanation of the differences.