From cb034b538b55a1e4c630e5a0f789a1bfda282f67 Mon Sep 17 00:00:00 2001 From: David Schenck Date: Sat, 16 Dec 2023 14:53:18 +0100 Subject: [PATCH] fix slicing on Collection --- doubledate/calendar.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/doubledate/calendar.py b/doubledate/calendar.py index 73fdd06..fdd4008 100644 --- a/doubledate/calendar.py +++ b/doubledate/calendar.py @@ -1578,19 +1578,13 @@ def nth(self, index, *, base=0, onerror=constants.RAISE) -> Calendar: def __getitem__(self, value) -> Calendar: """ - Slices or indexes each calendar, combining the result + Get calendar by index Returns ------- Calendar - - Note - ---- - Indices and slices thereof are assumed 0-based """ - return self.apply( - lambda calendar: calendar[value], onerror=constants.RAISE - ).combine() + return self.calendars[value] def index(self, value) -> int: """