Open iliya-malecki opened 8 months ago
Hello! Sorry to have been slow to reply.
This is an interesting idea, here's a few of my initial reactions:
#[pyfunction]
rather than a separate macro, but that'll very much depend on the design which emerges.I think we probably want the python side to have a 'generic' function which dispatches to Rust binding function. Otherwise, I feel like we are not really saving much boilerplates. This is also closer to 'generic' semantics. This naturally means we want to monophize for every type parameter as well. I am not sure whether publicly exposing these monophizations yo Pytjon is a good idea though.
Hello there! im currently using something like this in my project (please ignore the specifics, i want to share the general idea without ripping it out of the context that sparked the idea):
So, naturally, i wondered: is it a good idea to turn it into some sort of
concrete_function!()
macro to specialize generic functions to interface with python? on the python side, it could be implemented with an object with__getitem__
or__getattr__
to resolve what specific function to call. Do you think it is worth a dependency? Do you think this approach smells nice enough to be included in pyo3?