Dec-01-2019, 08:14 PM
(This post was last modified: Dec-01-2019, 08:15 PM by Gribouillis.)
Hi Sarah,
sarah Wrote:Defining parent Class in Python 2.7.11Don't use python 2.7. Its end of life is scheduled for January 1st, 2020.. Use python 3, otherwise you're going to learn obsolete things and you won't be able to run the code that everybody runs.
sarah Wrote:what is the conventional way to define Parent class is it with () or without ()?
- In current python 3, the conventional way is without ().
- In python 2.7, the conventional way is
class Test(object): pass
- The two ways you showed above work in python 2.7 but they define prehistoric "old style classes" that go back to python 1. I'm very nostalgic of python 1 but I wouldn't recommend it to anyone nowadays.