Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Fortran analog to python's super()?

Tags:

python

fortran

When working with classes and in particular with extended types in Fortran 2003/8: is there any analog of python's super() function that can be used to call a method from the extending type which has been overridden in the extended type?

like image 512
Thomas Cognata Avatar asked Aug 01 '13 20:08

Thomas Cognata


People also ask

What is super () in Python?

The super() function is used to give access to methods and properties of a parent or sibling class. The super() function returns an object that represents the parent class.

What is super () __ Init__ in Python?

Understanding Python super() with __init__() methodsThe super function returns a temporary object of the superclass that allows access to all of its methods to its child class. Note: For more information, refer to Inheritance in Python.

Is super () necessary Python?

In general it is necessary. And it's often necessary for it to be the first call in your init. It first calls the init function of the parent class ( dict ).

How do you call a super method in Python?

Super() to Call Super Class Constructor Here, the derived class Newdemo calls the super() with arguments a, b, and c. This causes the constructor __init__ of the base class, i.e. Demo to be called. This initialises the values of a, b, and c. Hence, the Newdemo class no longer initialises the values itself.


1 Answers

Yes, if the parent type is not abstract.

CALL object%ParentType%Binding(...)

Otherwise you can always just call the specific procedure that implements the binding in the parent.

like image 87
IanH Avatar answered Sep 27 '22 19:09

IanH