python / python/cpython

`_PyStaticType_Dealloc` should not exist.

Open
#101,603 2 comments 0 reactions 1 assignee View on GitHub

@ericsnowcurrently is already working on this.

Since Feb 6, 2023.

interpreter-core type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

This the twin to https://github.com/python/cpython/issues/96458, and the same reasoning applies.
If something is static it cannot be deallocated.

AFAICT, this clears subclasses of the static type, and doesn't deallocate the class.
The (class, subclass) relation for static types is an attribute of the interpreter not the class, so _PyStaticType_Dealloc needs to be renamed, at least.

_PyStaticType_Dealloc also allocates int objects, which is problematic during interpreter cleanup, as the MemoryError cache may be cleared first.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.