diff --git a/CHANGES.rst b/CHANGES.rst index 3befc8d9..bcfc793d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,7 +6,7 @@ Changelog Minor changes: -- ... +- Shorten first example in documentation. Breaking changes: diff --git a/README.rst b/README.rst index 0ff9a6c8..9d1969fe 100644 --- a/README.rst +++ b/README.rst @@ -67,9 +67,8 @@ You can open an ``.ics`` file and see all the events: >>> import icalendar >>> from pathlib import Path >>> ics_path = Path("src/icalendar/tests/calendars/example.ics") - >>> with ics_path.open() as f: - ... calendar = icalendar.Calendar.from_ical(f.read()) - >>> for event in calendar.walk('VEVENT'): + >>> calendar = icalendar.Calendar.from_ical(ics_path.read_bytes()) + >>> for event in calendar.events: ... print(event.get("SUMMARY")) New Year's Day Orthodox Christmas