Skip to content

Commit

Permalink
fix slicing on Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dschenck committed Dec 16, 2023
1 parent 1e0b013 commit cb034b5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions doubledate/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit cb034b5

Please sign in to comment.