3014: feat: add #[pyo3(get, set)] for Cell r=davidhewitt a=AntoineRR
This fixes#2659.
The types for which `#[pyo3(get, set)]` should now work are `Cell`, `Arc` and `Box`.
There is one issue regarding `Box`, the implementation of `FromPyObject` conflicts with another one. I could not find what the issue was, especially since the other implementations for `Arc` and `Cell` work as expected. The related code and test has been commented out for now. Maybe someone could help me fix this issue if I don't figure it out myself? There is also the possibility to remove the implementation for `Box` of course.
Co-authored-by: Antoine Romero-Romero <ant.romero2@orange.fr>
2930: add better error message for Python in signature r=adamreichold a=davidhewitt
Inspired by #2929, this just adds a better error message when `Python` arguments are accidentally included in the signature.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Since we're just testing a bug during traversal, we don't actually have
to reap the object, we just have to make a reference cycle so that it's
traverse method is called.
2796: Forward cfgs on pyclass fields to the method defs r=davidhewitt a=mejrs
With this and the cfg_attr PR, I don't need cfg_eval at all anymore :)
- [x] needs some more tests
Co-authored-by: mejrs <>
2739: error when `#[pyo3(signature = ())]` used on invalid methods r=davidhewitt a=davidhewitt
A follow-up to #2702 to reject some invalid applications of `#[pyo3(signature = (...))]` attribute, specifically on magic methods and getters / setters / class attributes.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
- Implement __ne__ as well as __eq__.
- Return NotImplemented when types cannot be converted, rather than
throwing.
- Compare the integer ids inside the __eq__/__ne__ implementation.
Previously a match block was generated.