Skip to content

clarify separation between rust code and python wrappers #779

Closed
@Michael-J-Ward

Description

@Michael-J-Ward

#750 added python wrappers instead of directly exposing pyo3 generated code.

We should leverage that to clean up and improve the rust codebase by:

  1. Letting python wrappers handle any aliases.
  2. Letting python wrappers handle any argument defaults, removing #[pyo3(signature(...))] annotations from the Rust codebase

Additionally, we should provide guidance so that contributors understand the separation.

@timsaucer recommends the following guidelines (and I agree):

I think it's worth adding some guidance about what to put in python vs what to put in rust for this repo. In my mind the things that should go into the python side are

* Trivial aliases (this is a good example)
* Simple type conversion, like path -> string of the path or number to lit(number)
* More complex type conversion if it makes sense to do in python. For example, in the named_struct where sending in a dictionary on the python side makes a lot more sense and isn't as simple to do via pyo3.

And then I'd lean towards everything else sitting on the rust side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions