Meta issue tracker, pt 2
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
This is the sequel to https://github.com/python/mypy/issues/11201. It's awesome to see most of the things in that issue fixed.
Type System Features
PEP 695 https://github.com/python/mypy/issues/15238PEP 702 https://github.com/python/mypy/issues/16111- PEP 675 https://github.com/python/mypy/issues/12554
PEP 696 https://github.com/python/mypy/issues/14851
Behaviour changes
-
Ternary unions https://github.com/python/mypy/issues/12056We should use unions in some places we currently join, see https://github.com/python/mypy/issues/12056#issuecomment-1694422734
Update: We now use unions in more places, including ternary expressions. Feel free to investigate this more though!
-
Always narrow types https://github.com/python/mypy/issues/2008#issuecomment-296213676 (proposal 3)
Users find it surprising because it seems obvious that mypy should know the variable is of the narrower type. There was a big discussion in typing-sig and all the type checkers agreed this behaviour was probably the best. The change is very easy, but exposes bugs in binder
-
Default value of generic parameters https://github.com/python/mypy/issues/3737#issuecomment-552840010
It's totally reasonable to want to have generic parameters with defaults, we should error at call sites in case of badness
-
Support narrowing Literal https://github.com/python/mypy/issues/12535
It's hard to really use Literal types without a good way to narrow them. We should also narrow on
==. I think last time I tried this it exposed bugs in binder -
Support property setters with broader types https://github.com/python/mypy/issues/3004Should also allow covariant overrides of getter
-
Better handling of__new__https://github.com/python/mypy/pull/16020This is part of the Python language and comes up weirdly frequently.
-
Love for match statement https://github.com/python/mypy/issues?q=is%3Aopen+label%3Atopic-match-statement+sort%3Areactions-%2B1-descUpdate: I fixed the most popular of these issues, but there's still a long tail of them
-
PEP 688 https://github.com/python/mypy/issues/15313Easy, is just a somewhat breaking change
UI
-
Per module strict=true https://github.com/python/mypy/issues/11401
There's maybe some other UI stuff we can think about for groups of flags and error codes, as discussed in meetup. I also don't like the new
--extra-checkssince flag name doesn't mean anything and can't be decomposed. -
Ability to override PEP 561 https://github.com/python/mypy/issues/8545It would be nice to be able to opt-in to treating packages missing py.typed as having py.typed. mypy can still provide a lot of value just based on function shape.
Update: this is now
--follow-untyped-imports(can be set per-module) -
Exclude should imply per-module follow_import=skip https://github.com/python/mypy/issues/10377
Currently
--excludeonly affects file discovery on command line, not import following. This is a source of frustration for users because the relevant modules can still end up being type checked. -
Provide flag to generate stubs requirements https://github.com/python/mypy/issues/10600#issuecomment-950170169
--install-typesis slow, results in unstable type checking, doesn't let users manage their own envs, can fail unclearly if cache isn't written -
Rethink stub suggestion logic https://github.com/python/mypy/issues/10619
Our current behaviour was needed to help the migration to modular typeshed, but is not behaviour we'd have designed from scratch.
Gradual typing
-
Make
check_untyped_defs = Truethe default https://github.com/python/mypy/issues/3948#issuecomment-890060233 / https://github.com/python/mypy/issues/6646We decided not to do this for mypy 1.0, but could still make sense in the future.
It could make sense to investigate and introduce other changes that make this more palatable, e.g. enable--allow-redefinition(-new), swallow var-annotated in untyped defs, etc -
Infer obvious return types https://github.com/python/mypy/issues/4409 / https://github.com/python/mypy/issues/10149
As a 1/3-way measure, we could also do https://github.com/python/mypy/issues/9413
-
Infer method types from superclass https://github.com/python/mypy/issues/3903#issuecomment-408833797
Performance
Parallel type checking https://github.com/python/mypy/issues/933Faster caching https://github.com/python/mypy/issues/3456
Misc
-
Member access https://github.com/python/mypy/issues/7724 -
Merge configuration docs https://github.com/python/mypy/issues/12347
See also a similar issue for mypyc here: https://github.com/mypyc/mypyc/issues/785
(other maintainers, feel free to edit)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza revisando las issues vinculadas que siguen abiertas en Type System Features, Behaviour changes, UI, Gradual typing y Misc, junto con las discusiones a las que hacen referencia. Este tracker no especifica archivos ni tests; para completarlo es necesario resolver los elementos pendientes seleccionados o trasladarlos a un trabajo con un alcance separado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- devtools
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100