Skip to content

Only float type should automatically convert to System.Double when target type is System.Object #1957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lostmsu opened this issue Sep 30, 2022 · 0 comments

Comments

@lostmsu
Copy link
Member

lostmsu commented Sep 30, 2022

Environment

  • Pythonnet version: 3.0.0

Details

var numpy = Py.Import("numpy");
var float64 = numpy.GetAttr("float64");
var float64Value = float64.Invoke(42.ToPython());
Console.WriteLine(float64Value.As<object>().GetType());

Expected: Python.Runtime.PyObject
Actual: System.Double

lostmsu added a commit to losttech/pythonnet that referenced this issue Sep 30, 2022
…, and `str` to corresponding .NET primitive types

fixes pythonnet#1957
lostmsu added a commit to losttech/pythonnet that referenced this issue Oct 24, 2022
…s when target type is System.Object

useful to be able to change what numpy.float64 is converted to

related to pythonnet#1957

this is an alternative to pythonnet#1958
@filmor filmor closed this as completed Oct 28, 2022
elan-ajain pushed a commit to elancapital/pythonnet that referenced this issue Feb 17, 2023
…s when target type is System.Object

useful to be able to change what numpy.float64 is converted to

related to pythonnet#1957

this is an alternative to pythonnet#1958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants