type_py Derived Type

type, public, extends(object) :: type_py

Type that represents a "class object". In Python class objects have the type 'type' which we name type_py here.



Type-Bound Procedures

procedure, public :: destroy => object_destroy

Call to allow for freeing of resources of this object.

  • private subroutine object_destroy(self)

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(inout) :: self

procedure, public :: getattribute => object_getattribute

Get value of an attribute of this object

  • private function object_getattribute(self, attr, attr_name) result(ierror)

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(in) :: self
    type(object), intent(out) :: attr
    character(kind=C_CHAR,len=*), intent(in) :: attr_name

    Return Value integer(kind=C_INT)

procedure, public :: setattr => object_setattr

Set value of an attribute of this object

  • private function object_setattr(self, attr_name, attr_value) result(ierror)

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(inout) :: self
    character(kind=C_CHAR,len=*), intent(in) :: attr_name
    class(object), intent(in) :: attr_value

    Return Value integer(kind=C_INT)

procedure, public :: delattr => object_delattr

Delete an attribute of this object

  • private function object_delattr(self, attr_name) result(ierror)

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(inout) :: self
    character(kind=C_CHAR,len=*), intent(in) :: attr_name

    Return Value integer(kind=C_INT)

procedure, public :: get_c_ptr => object_get_c_ptr

Get c_ptr representation of this object. For development of Python extension modules

  • private function object_get_c_ptr(self) result(r)

    Get C pointer to an object, needed for developing Python extensions.

    Arguments

    Type IntentOptional AttributesName
    class(object), intent(in) :: self

    Return Value type(c_ptr)