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.
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:
Expected:
This way, methods within the Animal class can be called directly.