1505: add CHANGELOG and test

This commit is contained in:
David Hewitt 2021-03-20 08:25:12 +00:00
parent adc6e6fe4e
commit e34e87ad4a
2 changed files with 27 additions and 0 deletions

View File

@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix incorrect `TypeError` raised when keyword-only argument passed along with a positional argument in `*args`. [#1440](https://github.com/PyO3/pyo3/pull/1440) - Fix incorrect `TypeError` raised when keyword-only argument passed along with a positional argument in `*args`. [#1440](https://github.com/PyO3/pyo3/pull/1440)
- Fix inability to use a named lifetime for `&PyTuple` of `*args` in `#[pyfunction]`. [#1440](https://github.com/PyO3/pyo3/pull/1440) - Fix inability to use a named lifetime for `&PyTuple` of `*args` in `#[pyfunction]`. [#1440](https://github.com/PyO3/pyo3/pull/1440)
- Fix inability to add `#[text_signature]` to some `#[pyproto]` methods. [#1483](https://github.com/PyO3/pyo3/pull/1483) - Fix inability to add `#[text_signature]` to some `#[pyproto]` methods. [#1483](https://github.com/PyO3/pyo3/pull/1483)
- Fix use of Python argument for #[pymethods] inside macro expansions. [#1505](https://github.com/PyO3/pyo3/pull/1505)
## [0.13.2] - 2021-02-12 ## [0.13.2] - 2021-02-12
### Packaging ### Packaging

View File

@ -727,3 +727,29 @@ fn test_raw_idents() {
); );
}) })
} }
// Regression test for issue 1505 - Python argument not detected correctly when inside a macro.
#[pyclass]
struct Issue1505 {}
macro_rules! issue_1505 {
(
#[pymethods]
impl $ty: ty {
fn $fn:ident (&self, $arg:ident : $arg_ty:ty) {}
}
) => {
#[pymethods]
impl $ty {
fn $fn(&self, $arg: $arg_ty) {}
}
};
}
issue_1505!(
#[pymethods]
impl Issue1505 {
fn issue_1505(&self, _py: Python<'_>) {}
}
);