You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The signature of __setitem__ for PySequenceProtocol implementations is not rewritten the right way, and the wrong argument is replaced. See example.
🌍 Environment
Your operating system and version: Linux (Archlinux)
Your python version: 3.7
How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?: pacman -S python
Your rust version (rustc --version): rustc 1.35.0-nightly (94fd04589 2019-03-21)
Are you using the latest pyo3 version? Have you tried using latest master (replace version = "0.x.y" with git = "https://github.com/PyO3/pyo3")? Tried with both v0.6.0 and master.
When trying to compile, the compiler will fail with:
error[E0053]: method `__setitem__` has an incompatible type for trait
--> src/lib.rs:15:3
|
15 | fn __setitem__(&mut self, key: isize, item: u8) -> PyResult<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected isize, found associated type
|
= note: expected type `fn(&'p mut MyList, isize, <MyList as pyo3::sequence::PySequenceSetItemProtocol<'p>>::Value) -> <MyList as pyo3::sequence::PySequenceSetItemProtocol<'p>>::Result`
found type `fn(&'p mut MyList, <MyList as pyo3::sequence::PySequenceSetItemProtocol<'p>>::Value, u8) -> <MyList as pyo3::sequence::PySequenceSetItemProtocol<'p>>::Result`
After running cargo expand, the actual signature generated by the pyproto macro is:
🐛 Bug Reports
The signature of
__setitem__
forPySequenceProtocol
implementations is not rewritten the right way, and the wrong argument is replaced. See example.🌍 Environment
pacman -S python
rustc --version
):rustc 1.35.0-nightly (94fd04589 2019-03-21)
version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
Tried with bothv0.6.0
andmaster
.💥 Reproducing
Minimal example:
When trying to compile, the compiler will fail with:
After running
cargo expand
, the actual signature generated by thepyproto
macro is:where it should be (if I'm not mistaken):
The text was updated successfully, but these errors were encountered: