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
In this first test we see that writing to the number did not raise an error, but had no effect.
Next I try to set the value of OtherItem:
>>> other = ComplexEnum.OtherItem(3)
>>> other
OtherItem {
value: 3,
}
>>> other.value = 4
Traceback (most recent call last):
File "<python-input-9>", line 1, in <module>
other.value = 4
^^^^^^^^^^^
AttributeError: attribute 'value' of 'builtins.ComplexEnum_OtherItem' objects is not writable
This at least raises an error, which is better than discarding thewrite silently, but it is still unexpected considering the set_all attribute was accepted.
Backtrace
Your operating system and version
Windows 10
Your Python version (python --version)
Python 3.13.2
Your Rust version (rustc --version)
rustc 1.85.0
Your PyO3 version
0.23.4
How did you install python? Did you use a virtualenv?
Yes, I'm using a virtualenv
Additional Info
No response
The text was updated successfully, but these errors were encountered:
Bug Description
I can annotate a complex enum as #[pyclass(get_all, set_all)], but set_all does not work.
It should either work or be rejected during compilation.
Steps to Reproduce
To demonstrate the issue I wrote the following code:
After building and installing the module, I tested it in the REPL:
In this first test we see that writing to the number did not raise an error, but had no effect.
Next I try to set the value of OtherItem:
This at least raises an error, which is better than discarding thewrite silently, but it is still unexpected considering the set_all attribute was accepted.
Backtrace
Your operating system and version
Windows 10
Your Python version (
python --version
)Python 3.13.2
Your Rust version (
rustc --version
)rustc 1.85.0
Your PyO3 version
0.23.4
How did you install python? Did you use a virtualenv?
Yes, I'm using a virtualenv
Additional Info
No response
The text was updated successfully, but these errors were encountered: