Open Mskxn opened 3 months ago
I expect that eventually be the same.
I never expect this is possible in CPython.
So this is the way to "clear" __dict__
.
It seems that del __dict__
is always possible in CPython (I have tried on CPython 3.10), but some relative tests have been introduced recently (3.13):
https://github.com/python/cpython/blob/81fd625b5c30cc6f417c93bad404923676ad8ca3/Lib/test/test_class.py#L817
For contributors:
current object_set_dict
function signature doesn't support delete.
Changing it to pub fn object_set_dict(obj: PyObjectRef, dict: PySetterValue<PyDictRef>, vm: &VirtualMachine) -> PyResult<()>
is the starting point.
The remaining steps will be straight-forward by understanding how PySetterValue looks like.
In CPython, the following code can execute normally.
But in rustpython, it triggers TypeError:
I am not sure if it is a design or a bug. P.S., Are there any docs to explain the consistency between CPython and rustpython, or they should be exactly the same?