It seems that the type checking functions are missing from the python interface in stdlib.
Would you be interested by a PR to add them or is there some other workaround to check for the type of a PythonObject?
It seems that the type checking functions are missing from the python interface in stdlib.
Would you be interested by a PR to add them or is there some other workaround to check for the type of a PythonObject?
Ah, these are C defines
GitHub
Looks like we want Integer Objects — Python 3.13.9 documentation
Here is the PR, feedback appreciated: [stdlib] Add PyLong_Check* support by winding-lines · Pull Request #5480 · modular/modular · GitHub
If/when this approach is acceptable I can extend to more types, in this PR or follow up PRs.
Many thanks,
Marius
Hi, I will review your PR in the coming two days. Thanks for the patch!
Thanks @sora !
I am propagating the pattern to bool and float this weekend. I will add the changes to this PR if you have not reviewed it yet, or a new PR if your review lands first.