as @Christian mentioned, you can specify the superclass of Foo
inside the brackets:
class Bar: pass
class Foo(Bar): #Foo is subclass of Bar now
pass
by default, if Foo
doesn't inherit any class, just omit the ()
:
class Foo: #this creates old-style classes in python2, which is not suggested
....
generally, we inherit from object
(in python2) to create new-style classes when writing our custom classes:
class Foo(object):
....