Search notes:

Python: super

super()
super(type)
super(type, obj )
super(type, type)
super() allows to call methods in a class's base class.
class A:

      def __init__(self, val):
          self.val = val

      def xyz(self):
          print('A.val = {}'.format(self.val))

class B(A):

      def __init__(self, val, txt):
          super().__init__(val)
          self.txt = txt

      def xyz(self):
          super().xyz()
          print('B.txt = {}'.format(self.txt))


a = A(11)
a.xyz()

b = B(42, 'hello world')
b.xyz()
Github repository about-Python, path: /builtin-functions/super/demo.py

See also

method resolution order.
Python: Built in functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206307, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/built-in-functions/super/index(72): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78