python / python/cpython

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

Aperta
#95,707 7 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@markshannon ci sta già lavorando.

Dal 5/8/2022.

3.12 3.13 docs interpreter-core performance type-feature
Lingua principale
Python
Stelle
77.2k
Fork
36k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.