◐ Shell
clean mode source ↗

Message 392402 - Python tracker

Victor:
> check_set_special_type_attr() is used to prevent setting the following attributes:
> [...]
> Right now, I cannot set the attribues on array.array type:
> [...]
> I guess that type_setattro() is used and it checks for Py_TPFLAGS_IMMUTABLETYPE flag early.

Is this always the case? If so, can we turn the check in check_set_special_type_attr() into an assert? In any case, Py_TPFLAGS_IMMUTABLETYPE should be used, not !Py_TPFLAGS_HEAPTYPE.