Challenging to diagnose bad expressions when using numerical comparison operators.
@klarose ya está trabajando en esto.
Desde el 27/9/2025.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
I have an expression where one side of a comparison operator fails (e.g. undeclared reference). The result is a "no matching overload" error, which isn't very helpful. I expect to see the original failure bubble up to the top of the evaluation.
E.g.
python3 -m celpy -n 'bad < 113.0'
ERROR: <input>:1:1 found no matching overload for 'relation_lt' applied to '(<class 'celpy.evaluation.CELEvalError'>, <class 'celpy.celtypes.DoubleType'>)'
| bad < 113.0
| ^
While the offending part of the expression is still in the output, it's still fairly misleading, and could cause code trying to customize error handling to do the wrong thing.
I took a quick gander where the failure occurs, and it seems to be that the builtin comparison operators don't have an overload for the CELEvalError class. Many of the others do. I'm not sure if this was a miss or on purpose.
Either way, hacking this in seemed to fix the problem:
diff --git a/src/celpy/evaluation.py b/src/celpy/evaluation.py
index 799b05c..8545a02 100644
--- a/src/celpy/evaluation.py
+++ b/src/celpy/evaluation.py
@@ -228,10 +228,22 @@ class CELEvalError(Exception):
def __rpow__(self, other: Any) -> "CELEvalError":
return self
+ def __lt__(self, other: Any) -> "CELEvalError":
+ raise self
+
+ def __le__(self, other: Any) -> "CELEvalError":
+ raise self
+
+ def __gt__(self, other: Any) -> "CELEvalError":
+ raise self
+
+ def __ge__(self, other: Any) -> "CELEvalError":
+ raise self
+
def __eq__(self, other: Any) -> bool:
if isinstance(other, CELEvalError):
return self.args == other.args
- return NotImplemented
+ raise self
def __call__(self, *args: Any) -> "CELEvalError":
return self
I can submit a PR if there's interest.
- Lenguaje dominante
- Python
- Estrellas
- 174
- Forks
- 41
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin 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 cloud-custodian/cel-python
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloud-custodian/cel-python#180 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
cloud-custodian/cel-python#194 ·
-
documentation enhancement tracking
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
cloud-custodian/cel-python#182 ·
-
Refresh FeaturesQuizá libre de nuevo @slott56 la tomó hace 139 días y no hay ningún pull request abierto. Abiertodependencies
cloud-custodian/cel-python#172 · 2 comentarios · 1 asignado ·
-
Permit multiple threads to share a common EnvironmentQuizá libre de nuevo @Quantum0uasar la tomó hace 126 días y no hay ningún pull request abierto. Abiertoenhancement
cloud-custodian/cel-python#169 · 3 comentarios · 1 asignado ·
Todos los issues de cloud-custodian/cel-python
Issues similares
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reusedPosiblemente ocupada @sylvesterkaczmarek la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
google-deepmind/bsuite#56 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
LearningCircuit/local-deep-research#7206 ·
Los mantenedores suelen responder en 1 día
-
[TASK] Document technology stackAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chingu-voyages/V62-tier3-team-33#285 ·
Los mantenedores suelen responder en 1 día
-
Proxy drops log notifications from backends that don't send FastMCP's msg/extra dictPosiblemente ocupada @asasemahmed la tomó hoy. Abiertobug server
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día