First page Back Continue Last page Overview Graphics

Minimal Class in Python

class Robot:

pass

We can use this class even though it consists

only of a pass statement:

x = Robot()

y = Robot()

y2 = y

print(y == y2)

print(y == x)

!

In Python2 we have to write

class Robot(object):

pass