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

Fix int_ and bool_ types #40

Closed
ixje opened this issue Aug 27, 2020 · 4 comments
Closed

Fix int_ and bool_ types #40

ixje opened this issue Aug 27, 2020 · 4 comments
Labels
question Further information is requested

Comments

@ixje
Copy link
Contributor

ixje commented Aug 27, 2020

I discussed this somewhere before (can't recall where), but some signatures contain int_ and bool_ (for respectively returning py::int_ and py::bool_ from the binding side). The only logical and valid signature types would be int and bool. I currently do a second pass to myself to convert these. Is it an idea to fix these here or do you recon it should be fixed on the pybind11 side ?

@sizmailov
Copy link
Owner

Which version of pybind11 do you use? At least int_ should not be a problem since pybind/pybind11#2212. The same can be done for bool_ as well. I didn't spot it at the time.

@sizmailov
Copy link
Owner

IMO all C++ oddities in docstrings are due to bugs in pybind11/bindings code or both. Therefore fixing it afterwards here should be the last resort. I'm thinking about rewiring internals of the library to make it more customizable for such cancer cases where there is no (easy) way to fix C++ sources.

@sizmailov sizmailov added the question Further information is requested label Aug 27, 2020
@ixje
Copy link
Contributor Author

ixje commented Aug 27, 2020

I'm on 2.5.0 (latest tag) so that explains.

  • I didn't test, but I'm guessing py::float_ probably produces float_ and could point to float.
  • there is also py::buffer that currently just translates to buffer. Instead it could do a best effort of translating to Union[bytes, bytearray, memoryview] (python issue, mypy issue)

@sizmailov
Copy link
Owner

I don't think py::float_ actually appear as a return type or an argument anywhere so it's didn't show up, but it still makes sense to fix it. I doubt that PR with Union[...] alias for py::buffer would be an accepted (although you can use it on your own code). Anyhow this is out of scope of this repo (as I see it), therefore I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants