Skip to content

Function and method return types #49

Description

@toaction

Currently, all function/method return types are *py.Object, rather than concrete Python types.

In actual usage, we may need to convert *py.Object to concrete Python types in order to use type-specific features, such as calling methods within a class.

For example, if a function actually returns a class object. Current approach:

type Animal struct {
    py.Object
}

// return Animal obj
func Example() *py.Object

Expected:

type Animal struct {
    py.Object
}

func Example() *Animal

This way, methods within the Animal class can be called directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions