Python/Fortran interoperability

sturlamolden sturlamolden at
Mon Aug 24 01:17:19 CEST 2009

On 23 Aug, 20:42, n... at wrote:

> That is precisely what I am investigating.  TR 29113 falls a LONG
> way before it gets to any of the OOP data - indeed, you can't even
> pass OOP derived types as pure data (without even the functionality)
> in its model.  Nor most of what else Python would expect.

I am note sure what you mean. This has the same ABI:

typedef struct {
    int m, n;
    float r;
} myctype;

use iso_c_binding
type, bind(c) :: myftype
    integer(c_int) :: m, n
    real(c_float) :: s
end type

You thus can pass derived types between C and Fortran.

More information about the Python-list mailing list