More flexible type support for `math.prod` and `math.sumprod`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Empieza inspeccionando los stubs de tipos de math.prod y math.sumprod, y compara después su comportamiento con el stub de builtins.sum. Usa los ejemplos enlazados de Mypy Playground para comprobar la inferencia de Decimal, Fraction y complex, y confirma los tipos resultantes y cualquier posible problema de compatibilidad antes de dar por cerrado el issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Also related to https://github.com/python/typeshed/issues/11913
Currently, math.prod and math.sumprod do not properly support Decimal, Fraction, complex, or possibly other numeric types. This makes it inconvenient to replace builtins.sum with math.prod in a straightforward manner.
from typing import reveal_type
from fractions import Fraction
from math import prod
a = prod([Fraction(1), Fraction(2)])
reveal_type(a) # it should be Fraction | Literal[1], but float for now
prod([complex(1, 0), complex(1, 2)])
I believe it should be followed the type stub of builtins.sum, but I’m not sure what breaking changes this might cause.
- Lenguaje dominante
- Python
- Estrellas
- 5.1k
- Forks
- 2.1k
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 115
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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.
Más de python/typeshed
-
`networkx.set_edge_attributes` should support scalar value + namePosiblemente ocupada @Fire162 la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
false alarm on decode callPosiblemente ocupada @jw9829 la tomó hace 37 días. Abiertohelp wanted stubs: false positive
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/typeshed#16441 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Don't run pyright basic checks on projects with strict pyright settings in CIPosiblemente ocupada @Mohith1612 la tomó hace 74 días. Abiertoproject: infrastructure
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
python/typeshed#16005 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
stubs: improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python/typeshed#15548 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
stubs: improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
python/typeshed#15529 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de python/typeshed
Issues similares
-
Paraxial.trace returns NaN for an object at infinity when the entrance pupil is at the first surfaceAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
enhancement ios launcher
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion#27059 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
loteran/Arctis-Sound-Manager#368 ·
Los mantenedores suelen responder en 1 día
-
feed submission
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MobilityData/mobility-database-catalogs#1787 ·
Los mantenedores suelen responder en 2 días