On 11/11/2022 5:07 PM, Ian Pilcher wrote:
On 11/11/22 11:02, Thomas Passin wrote:
You can define a classmethod in SubClass that seems to do the job:

class SuperClass(object):
       @staticmethod
       def spam():  # "spam" and "eggs" are a Python tradition
           print('spam from SuperClass')

class SubClass(SuperClass):
     @classmethod
     def eggs(self):
         super().spam()

SubClass.eggs()  # Prints "spam from SuperClass"


That did it!  Thanks!

Glad I could help.  I probably should have written

     def eggs(clas):  # instead of "self"

but it's not actually used anyway.

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to