python / python/cpython

Support the use of the managed pre-header in builtin classes.

Abierto
#95,707 7 comentarios 0 reacciones 1 asignado Ver en GitHub

@markshannon ya está trabajando en esto.

Desde el 5/8/2022.

3.12 3.13 docs interpreter-core performance type-feature
Lenguaje dominante
Python
Estrellas
77.2k
Forks
36k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Currently Py_TPFLAGS_MANAGED_DICT is an internal-only flag, in fact setting in third-party code is likely to lead to a crash.
We would like to expose it, and a weakref equivalent Py_TPFLAGS_MANAGED_WEAKREFS to allow builtin classes to take advantage of compact object layout.
Compact layout uses less memory, performs better and allow more robust subclassing. So everyone should be able to use it.

  • Fix crashes when Py_TPFLAGS_MANAGED_DICT is used
  • Add Py_TPFLAGS_MANAGED_WEAKREFS
  • Document how to use these flags, and the upgrade path from tp_dictoffset and tp_weakreflist

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.