2021-04-17 21:22:06 +00:00
|
|
|
#![deny(deprecated)]
|
|
|
|
|
|
|
|
use pyo3::prelude::*;
|
|
|
|
|
2022-10-25 06:23:21 +00:00
|
|
|
#[pyfunction(_opt = "None", x = "5")]
|
|
|
|
fn function_with_args(_opt: Option<i32>, _x: i32) {}
|
|
|
|
|
2023-01-15 10:17:10 +00:00
|
|
|
#[pyfunction]
|
|
|
|
fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
|
|
|
|
|
2022-10-25 06:23:21 +00:00
|
|
|
#[pyclass]
|
|
|
|
struct MyClass;
|
2021-04-17 21:22:06 +00:00
|
|
|
|
2022-10-25 06:23:21 +00:00
|
|
|
#[pymethods]
|
|
|
|
impl MyClass {
|
|
|
|
#[args(_opt = "None", x = "5")]
|
|
|
|
fn function_with_args(&self, _opt: Option<i32>, _x: i32) {}
|
2023-01-15 10:17:10 +00:00
|
|
|
|
|
|
|
#[args(_has_default = 1)]
|
|
|
|
fn default_arg_before_required_deprecated(&self, _has_default: isize, _required: isize) {}
|
2022-10-25 06:23:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2023-01-15 10:17:10 +00:00
|
|
|
function_with_required_after_option(None, 0);
|
2022-10-25 06:23:21 +00:00
|
|
|
function_with_args(None, 0);
|
2021-04-17 21:22:06 +00:00
|
|
|
}
|