Message343100
This is another catch of using PyType_FromSpec (similar to https://bugs.python.org/issue26979 but also completely different).
Because PyType_FromSpec produces a heap type it gets the Py_TPFLAGS_HEAPTYPE flag set on the newly produced type. To enforce the immutability of built-in types type_setattro checks this flag. Therefore these types end up being mutable, e.g:
import _ssl
_ssl.SSLError.x = 42
In addition to not providing parity for replacing PyType_Ready in the stable API, it also means that this could presumably bleed across sub-interpreters or just provide surprising and bad results. |
|
Date |
User |
Action |
Args |
2019-05-21 21:31:10 | dino.viehland | set | recipients:
+ dino.viehland, vstinner, eric.snow |
2019-05-21 21:31:10 | dino.viehland | set | messageid: <1558474270.84.0.958874839775.issue37002@roundup.psfhosted.org> |
2019-05-21 21:31:10 | dino.viehland | link | issue37002 messages |
2019-05-21 21:31:10 | dino.viehland | create | |
|