Merge pull request #515 from kngwyu/guide-str-arg

Add arg=string example in the method arguments section in the guide
This commit is contained in:
konstin 2019-06-21 20:54:26 +02:00 committed by GitHub
commit 9669edbfe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -460,8 +460,8 @@ use pyo3::types::{PyDict, PyTuple};
#
#[pymethods]
impl MyClass {
#[args(arg1=true, args="*", arg2=10, kwargs="**")]
fn method(&self, arg1: bool, args: &PyTuple, arg2: i32, kwargs: Option<&PyDict>) -> PyResult<i32> {
#[args(arg1=true, args="*", arg2=10, args3="\"Hello\"", kwargs="**")]
fn method(&self, arg1: bool, args: &PyTuple, arg2: i32, arg3: &str, kwargs: Option<&PyDict>) -> PyResult<i32> {
Ok(1)
}
}