Skip to content

dynamic PyObject cast required inconsistenly #86

Closed
@den-run-ai

Description

@den-run-ai

I'm passing a float as dynamic PyObject from Python to C# and this kind of assignment is automagically accepted:

double csharpfloat = PythonFunctionReturningFloat();

But when using this PyObject in other numerical operations, then explicit casting is required:

double csharpfloat = 1/(double)PythonFunctionReturningFloat();
double csharpfloat += (double)PythonFunctionReturningFloat();

Any reason for such inconsistent behavior?

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