Should the class get the Py_TPFLAGS_MANAGED_DICT flag?
(cl: ClassIR, emitter: Emitter)
| 1281 | |
| 1282 | |
| 1283 | def has_managed_dict(cl: ClassIR, emitter: Emitter) -> bool: |
| 1284 | """Should the class get the Py_TPFLAGS_MANAGED_DICT flag?""" |
| 1285 | # On 3.11 and earlier the flag doesn't exist and we use |
| 1286 | # tp_dictoffset instead. If a class inherits from Exception, the |
| 1287 | # flag conflicts with tp_dictoffset set in the base class. |
| 1288 | return ( |
| 1289 | emitter.capi_version >= (3, 12) |
| 1290 | and cl.has_dict |
| 1291 | and cl.builtin_base != "PyBaseExceptionObject" |
| 1292 | ) |
| 1293 | |
| 1294 | |
| 1295 | def native_class_doc_initializer(cl: ClassIR) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…