2021-04-17 21:22:06 +00:00
|
|
|
#![deny(deprecated)]
|
2024-03-15 10:25:27 +00:00
|
|
|
#![allow(dead_code)]
|
2021-04-17 21:22:06 +00:00
|
|
|
|
|
|
|
use pyo3::prelude::*;
|
|
|
|
|
2024-05-10 10:34:58 +00:00
|
|
|
fn extract_options(obj: &Bound<'_, PyAny>) -> PyResult<Option<i32>> {
|
|
|
|
obj.extract()
|
|
|
|
}
|
|
|
|
|
|
|
|
#[pyfunction]
|
|
|
|
#[pyo3(signature = (_i, _any=None))]
|
|
|
|
fn pyfunction_option_1(_i: u32, _any: Option<i32>) {}
|
|
|
|
|
|
|
|
#[pyfunction]
|
|
|
|
fn pyfunction_option_2(_i: u32, _any: Option<i32>) {}
|
|
|
|
|
|
|
|
#[pyfunction]
|
|
|
|
fn pyfunction_option_3(_i: u32, _any: Option<i32>, _foo: Option<String>) {}
|
|
|
|
|
|
|
|
#[pyfunction]
|
|
|
|
fn pyfunction_option_4(
|
|
|
|
_i: u32,
|
|
|
|
#[pyo3(from_py_with = "extract_options")] _any: Option<i32>,
|
|
|
|
_foo: Option<String>,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
2024-05-31 14:13:30 +00:00
|
|
|
#[pyclass]
|
|
|
|
pub enum SimpleEnumWithoutEq {
|
|
|
|
VariamtA,
|
|
|
|
VariantB,
|
|
|
|
}
|
2024-07-09 16:44:27 +00:00
|
|
|
|
|
|
|
fn main() {}
|