Python 2.x class in 3.x
There isn't one single way to translate your class from Python 2 to Python 3.

You could try using the command-line tool 2to3 to do the translation, but it's not perfect, so you'll need to verify the results.