From 518b7b139b88eb870ed39b3fc4f9e73f523a5b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Jab=C5=82o=C5=84ski?= Date: Tue, 18 Dec 2018 13:07:15 +0100 Subject: [PATCH] Better implementation of at_least The old one used two calls of times() --- src/parsy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parsy/__init__.py b/src/parsy/__init__.py index de5aae7..f9f2a04 100644 --- a/src/parsy/__init__.py +++ b/src/parsy/__init__.py @@ -170,7 +170,7 @@ def at_most(self, n): return self.times(0, n) def at_least(self, n): - return self.times(n) + self.many() + return self.times(n, float('inf')) def optional(self): return self.times(0, 1).map(lambda v: v[0] if v else None)