From a8f731a63d12ef3eb6a59425ce8e77579942027d Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Sat, 18 Jul 2020 15:44:45 +0200 Subject: [PATCH] Fix type annotation of `LineageHandler` to accept `None` as distance argument --- pronto/logic/lineage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pronto/logic/lineage.py b/pronto/logic/lineage.py index ed6e7a1..e34f6b1 100644 --- a/pronto/logic/lineage.py +++ b/pronto/logic/lineage.py @@ -44,11 +44,11 @@ def __eq__(self, other: object) -> bool: class LineageHandler(Iterable["Term"]): - def __init__(self, term: "Term", distance: int, with_self: Optional[int]): + def __init__(self, term: "Term", distance: Optional[int], with_self: Optional[int]): self.term = term self.distance = distance self.with_self = with_self - # API compatibilty with previous iterator + # TODO: API compatibilty with previous iterator (remove for v3.0.0) self._it = None def __next__(self):