getsentry / getsentry/sentry-python

Use `ParamSpec` for shared kwargs

Abierto
#2,321 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Component: DX Improvement Python Quality Improvement
Lenguaje dominante
Python
Estrellas
2.2k
Forks
669
Merge medio
1 d 1 h
PR fusionados (30 d)
213

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

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.