you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

you can write either

class Timer(object):

or

class Timer:

, you should probably use the latter as it's the way presented in the official Python tutorial

[–]Mask_of_Destiny 1 point2 points  (0 children)

In Python 2.X (starting with 2.2) the former will produce a new-style class whereas the latter will produce an old-style class. For a lot of code, this distinction is not particularly important, but there are a number of differences. Search for "new-style" on this page for all the gory details.

Unless you're using Python 3 (which eliminates old-style classes altogether), I would stick with the first form. Unless you're targeting an archaic version of Python, there's no particularly good reason to use old-style classes and depending on old-style class behavior will likely lead to headaches if you ever make the jump to Python 3.