getsentry / getsentry/sentry-python
Use `ParamSpec` for shared kwargs
- Linguagem predominante
- Python
- Estrelas
- 2.2k
- Forks
- 669
- Merge médio
- 1d 40min
- PRs com merge (30d)
- 212
Descrição
### Problem Statement
We have a couple of hacks in place in the SDK (e.g. [here](https://github.com/getsentry/sentry-python/blob/b2c9af9d80859ba6a9e917daa02eb5f20d189591/sentry_sdk/client.py#L639-L659)) to enable autocompletion for things that share `args`/`kwargs` without having to duplicate said `args`/`kwargs` in multiple places.
### Solution Brainstorm
Python 3.10 (and `typing_extensions` for lower Python versions) includes support for `ParamSpec` https://sobolevn.me/2021/12/paramspec-guide that allows type signatures to "share" args/kwargs between functions. See if we can use this to replace the existing hacks.
Make sure that you get proper typing hints in an IDE (best to check both e.g. VSCode and PyCharm) and that [the API docs](https://getsentry.github.io/sentry-python/api.html) are also correct.
Guia de contribuição
Direção de pesquisa
Comece pelo tratamento compartilhado de args/kwargs em sentry_sdk/client.py, especialmente nas linhas 639-659, e inspecione as assinaturas relacionadas em todo o SDK. Verifique o suporte a ParamSpec nas versões do Python suportadas pelo projeto e em typing_extensions; depois, verifique o autocompletar no VSCode e no PyCharm e confirme que a documentação de API gerada em getsentry.github.io/sentry-python/api.html exibe as assinaturas pretendidas.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- developer-experience
- Tipo de issue
- Refatoração
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100