python / python/cpython

Add PEP 741 PyInitConfig API to the limited C API

Aperta
#149,163 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

interpreter-core topic-C-API
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

The GDB project would be interested to use the limited C API to embed Python. Some APIs used by GDB are missing from the limited C API (well, it's limited ;-)), one of them is the PEP 741 PyInitConfig API.

I propose adding PEP 741 PyInitConfig API to the limited C API.

PEP 741 Rationale lists other projects embedding Python. More projects would benefit from PyInitConfig being in the limited C API.

For example, the vim text editor uses dlopen/dlsym and GetProcAddress on Windows to get Python symbols at runtime. The libpython library is loaded on demand (at the first Python usage). vim already supports the stable ABI. See src/if_python3.c.

So far, I found pyinstaller which already adopted the PyInitConfig API.

Linked PRs
  • gh-149194

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.

Direzione di ricerca

Leggi la motivazione dell'embedding in PEP 741 e analizza src/if_python3.c di Vim per comprendere il caso d'uso della limited ABI. Poi esamina il PR collegato gh-149194 e il lavoro sulla limited C API; il lavoro è completato quando PyInitConfig è disponibile tramite questa API per i progetti che incorporano Python.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, python
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.