From 071766efc2e32d8cd7c9ee0a8633ffdd62513e2e Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Wed, 3 Jan 2024 20:40:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Use=20Optional=20instead=20of=20?= =?UTF-8?q?|=20none,=20for=20Python=20<3.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dinglehopper/align.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dinglehopper/align.py b/src/dinglehopper/align.py index 1f7957a..c5f12f7 100644 --- a/src/dinglehopper/align.py +++ b/src/dinglehopper/align.py @@ -1,6 +1,7 @@ import math import unicodedata from math import ceil +from typing import Optional from rapidfuzz.distance import Levenshtein @@ -14,7 +15,7 @@ def align(t1, t2): return seq_align(s1, s2) -def score_hint(er: float, n: int) -> int | None: +def score_hint(er: float, n: int) -> Optional[int]: """Calculate RapidFuzz score hint for a given error rate and count. Gives the score hint for the distance functions (= expected distance) or None if