Skip to content
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

Conversion rules for numpy [and ctypes] scalars #62

Closed
cjdoris opened this issue Oct 18, 2021 · 3 comments
Closed

Conversion rules for numpy [and ctypes] scalars #62

cjdoris opened this issue Oct 18, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@cjdoris
Copy link
Collaborator

cjdoris commented Oct 18, 2021

These are already in src/old/cpython/CPython.jl, just need migrating.

@cjdoris cjdoris added the enhancement New feature or request label Oct 18, 2021
@cjdoris
Copy link
Collaborator Author

cjdoris commented Oct 18, 2021

Actually ctypes scalars are mutable and expose the buffer interface, so just keep these as-is.

@cjdoris cjdoris changed the title Conversion rules for numpy and ctypes scalars Conversion rules for numpy ~~and ctypes~~ scalars Oct 18, 2021
@cjdoris cjdoris changed the title Conversion rules for numpy ~~and ctypes~~ scalars Conversion rules for numpy --and ctypes-- scalars Oct 18, 2021
@cjdoris cjdoris changed the title Conversion rules for numpy --and ctypes-- scalars Conversion rules for numpy [and ctypes] scalars Oct 18, 2021
@cjdoris
Copy link
Collaborator Author

cjdoris commented Oct 23, 2021

Numpy scalars already support conversion to Number because they are subtypes of numbers.Number etc.

But it would be good to convert numpy.int32 to Int32 by directly reading the value from the object.

@cjdoris
Copy link
Collaborator Author

cjdoris commented Apr 21, 2022

Done a while ago!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant