Skip to content

Commit

Permalink
Should recommend to use .objects rather than .events. Particularly du…
Browse files Browse the repository at this point in the history
…e to #116
  • Loading branch information
tobixen committed Mar 10, 2021
1 parent c6290a3 commit 4cfc84a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/basic_usage_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
## events()-method. Recurring events will not be expanded.
all_events = the_same_calendar.events()

## It's also possible to use .objects.
all_objects = the_same_calendar.objects()

## since we have only added events (and neither todos nor journals), those
## should be equal ... except, all_objects is an iterator and not a list.
assert(len(all_events) == len(list(all_objects))

## Let's check that the summary got right
assert all_events[0].vobject_instance.vevent.summary.value.startswith('Norwegian')

Expand Down

0 comments on commit 4cfc84a

Please sign in to comment.