From c163f20c26137c23bd104ee6fe361e1c330e151f Mon Sep 17 00:00:00 2001 From: julienmalard Date: Mon, 20 Nov 2023 17:00:12 +0100 Subject: [PATCH] Ajustement fonction stable --- constellationPy/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/constellationPy/utils.py b/constellationPy/utils.py index b76a17b..0d3ea50 100644 --- a/constellationPy/utils.py +++ b/constellationPy/utils.py @@ -2,6 +2,7 @@ import inspect import json +import logging from typing import Any, TypedDict, Callable, Coroutine, Awaitable, Optional from typing import TYPE_CHECKING @@ -84,7 +85,8 @@ def attendre_stabilité(n: int | float) -> Callable[[Any], Awaitable[bool]]: précédente = {} async def stable(val: Any): - chaîne_val = json.dumps(val) + chaîne_val = json.dumps(val, ensure_ascii=False) + if "val" in précédente and chaîne_val == précédente["val"]: return False