[pythonvis] Question on classes in Python

  • From: "Jeffrey Thompson" <jthomp@xxxxxxxxxxx>
  • To: <pythonvis@xxxxxxxxxxxxx>
  • Date: Thu, 12 Feb 2015 16:52:19 -0500

                Hello boa constricters! ... No that's not quite right, hmmm
... Pythonistas!,

 

 

                Question for Python group on 2-11-15

                These questions are about class inheritance.

If you don't understand this stuff below, start by reading Richard's slices
of Py by reading the "class" slices in the order that they have been posted.

The slice of Py series by Richard Dinger has been starting to get into
classes. 

"Inheritance" may become available shortly with descriptions and examples.

A couple of questions on inheritance in classes in python.

 

How does one access the items in a grandfather class in the hierarchy,

e.g.: class Jobs to do -> Dirty Jobs to do -> dirty and smelly jobs to do;

Which means that Dirty Jobs to do inherits from Jobs to do.

and Dirty and Smelly Jobs to do inherits

Dirty Jobs to do.

 

I know that dirty and smelly jobs to do can use the keyword "super" to
access the class dirty jobs to do;

but how does one access class "Jobs to do" from class Dirty and smelly jobs?


 

Would it be super(super) ?

Or do you need the name of the grandfather class?

 

2)Important follow-up questions

Is a subclass a class for submarines?

And what if you would like to inherit a class that's good but not really
super?

 

                Jet (Jeff Thompson

                

 

                

 

                

 

                

Other related posts: