In python 2.x there is some motion to define classes in the new-style
class Foo(object):
rather the old-style
class Foo:
For python 3.x I read that this ambiguity goes away. But I am not sure what this means.
Two questions:
- What is the proper style for class definitions in python 3.x
- What is the recommendation for class definitions for python 2.x code, that will eventually upgraded to python 3.x code
In Python 3 all class are “new-style”. Both syntaxes do the same thing in Python 3.x.
In Python 2.x the recommendation is to always use new-style classes when writing new code. This applies regardless of whether you plan to upgrade to Python 3.x or not.