[libre-riscv-dev] [Bug 146] create python bindings to reference FP implementation

Jacob Lifshay programmerjake at gmail.com
Mon Nov 25 04:35:02 GMT 2019


On Sun, Nov 24, 2019, 19:23 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> On Mon, Nov 25, 2019 at 12:06 AM <bugzilla-daemon at libre-riscv.org> wrote:
>
> > http://bugs.libre-riscv.org/show_bug.cgi?id=146
> >
> > --- Comment #8 from Jacob Lifshay <programmerjake at gmail.com> ---
> > currently working on pull request on PyO3 (Rust/Python bindings library)
> > that
> > adds support for setting __text_signature__:
> > https://github.com/PyO3/pyo3/pull/675
>
>
> this isn't python main, is it?  if it's a library it's fine.  if it's a bug
> in the main python executable that's a royal nuisance.
>

It's an addition to the procedural macros (basically rust compiler plugin)
that generate all the code for binding rust with python.

it adds support for writing:

/// my_fn docs
#[pyfunction]
#[text_signature = "my_fn(a, b, c)"]
/// more docs
fn my_fn(a: i32, b: i32, c: i32) {
    ...
}

instead of:

// docs must start with exactly
// "<signature>\n--\n\n" to be detected as text_signature:

/// my_fn(a, b, c)
/// --
///
/// my_fn docs
/// more docs
#[pyfunction]
fn my_fn(a: i32, b: i32, c: i32) {
    ...
}

Jacob

>


More information about the libre-riscv-dev mailing list