Export real functions for things that currently exist as macros / defines / global variables in the C code
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
Direção de pesquisa
Nenhum arquivo, teste ou entrada de API específica é nomeado. Comece revisando a C DLL API em busca das macros, defines e variáveis globais mencionados; defina um conjunto limitado de alternativas de funções e verifique se os itens selecionados são exportados e podem ser usados a partir de um wrapper de nível mais alto.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Feature or enhancement
(A clear and concise description of your proposal.)
Pitch
I am writing a python wrapper in a higher level language using the C DLL API. Within certain higher level languages, it is not easily possible to access anything other than the exported functions from the DLL. Macros / defines / global variables are troublesome to interact with from the DLL.
So, If I only have easy access to the function API in my higher level language, type checking sort of becomes an issue due to things like PyList_Check being a macro and PyList_Type being a global variable. Exposing global variables (such as PyList_Type) through function APIs that just return a pointer to the data (for example) prevents a structure re layout from leaking out of the DLL... not to mention gives easier access to the data I need to call a type check function.
For things like PyList_Check that are macros, but are still useful for direct checks, they could be converted to a function API.
(Explain why this feature or enhancement should be implemented and how it would be used.
Add examples, if applicable.)
I do not suggest converting macros / defines cold turkey into a function API... obviously, that could break a lot of code for users of the C library. Instead, provide function alternatives to the items as a parallel API for those of us that can only really call DLL functions in our higher level language. As I go through some of the C API, I do notice areas where a macro and a function form of an API do exist in parallel. It would be nice if we could continue to extend that, especially for type checks.
Previous discussion
Apologies if this is discussed elsewhere. Move or edit as needed.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 558
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python/cpython
-
docs pending
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
stdlib type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
stdlib type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
build type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
stdlib topic-email type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Todas as issues de python/cpython
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
-
🐛 Bug 🔔 Pending processing
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
jumpserver/jumpserver#17584 ·