You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been looking around the documentation but I have not found a way to specify a different name for a class method than the rust function signature.
According to the docs you can do this for a standard function like so:
@cmyr no problem at all, I agree there's a documentation issue here. I've been trying to start solving this problem by making the attribute syntax more uniform: #1567
The idea being that the attribute will become #[pyo3(name = "...")], and we'll document all the options that the #[pyo3(...)] attribute will support.
If you have a moment to read through that PR, I'd welcome your opinion on the design proposal.
I have been looking around the documentation but I have not found a way to specify a different name for a class method than the rust function signature.
According to the docs you can do this for a standard function like so:
(rust function is called 'sum_as_string_py', but in python you call 'sum_as_string'
I would love to be able to do something similar for a classes' methods:
This way you can give functions in the rust interface the same name as their python counterparts:
The text was updated successfully, but these errors were encountered: