Skip to content

docs(boolean): improve vBoolean docstring#1386

Open
tsai135 wants to merge 1 commit into
collective:mainfrom
tsai135:docstring-calendar-description
Open

docs(boolean): improve vBoolean docstring#1386
tsai135 wants to merge 1 commit into
collective:mainfrom
tsai135:docstring-calendar-description

Conversation

@tsai135
Copy link
Copy Markdown

@tsai135 tsai135 commented May 14, 2026

Closes issue

This PR addresses one of the unchecked items in the #1244 checklist: vBoolean. It does not close the umbrella issue.

Description

The existing class docstring for vBoolean contains RFC-style documentation copied from RFC 5545, including sections such as “Value Name,” “Purpose,” “Format Definition,” and “Description.” The umbrella issue asks for these copied RFC sections to be rewritten as Pythonic docstrings.

This PR follows the pattern used in recent #1338 docstring PR:

  • Lead with a summary of what vBoolean does in Python terms.
  • Explain that vBoolean converts between Python boolean values and the iCalendar BOOLEAN value type.
  • Note that iCalendar boolean values are represented as TRUE or FALSE, and that values parsed from iCalendar text are case-insensitive.
  • Reference the RFC section via a :rfc: directive so Sphinx renders a linked reference instead of copying RFC text.
  • End with a working pycon example showing parsing from iCalendar text and serializing back to iCalendar bytes.

The RFC text itself is no longer copied into the class docstring; the :rfc: link is used as the canonical reference.

The CHANGES.rst entry slots in next to the other :issue: 1244 entries under the 7.0.4 Documentation section.

Checklist

  • I've added a change log entry to CHANGES.rst.
  • I've added or updated tests if applicable.
  • I've run and ensured all tests pass locally by following Run tests.
  • I've added or edited documentation, both as docstrings to be rendered in the API documentation and narrative documentation, as necessary.

The doctest suite (uv run pytest src/icalendar/tests/test_with_doctest.py) passes locally with the new example.

Additional information

The other unchecked items under vBoolean in #1244 are intentionally left for separate PRs to keep this change reviewable.


📚 Documentation preview 📚: https://icalendar--1386.org.readthedocs.build/

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 icalendar | 🛠️ Build #32688335 | 📁 Comparing 72e3e6c against latest (66fb3e1)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a change to the change log, and I'll merge. This is excellent work. Thank you!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfect!

Comment thread CHANGES.rst
~~~~~~~~~~~~~

- Replace the RFC quotations in the docstrings for :attr:`Alarm.REPEAT <icalendar.cal.alarm.Alarm.REPEAT>` and :attr:`Alarm.DURATION <icalendar.cal.alarm.Alarm.DURATION>` with Pythonic descriptions, including parameter notes, conformance references, and worked examples. :issue:`1244`
- Replace the RFC quotation in the docstring for :class:`vBoolean <icalendar.prop.boolean.vBoolean>` with a Pythonic description, including parsing behavior, a conformance reference, and a worked example. :issue:`1244`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've changed our change log format in v7.1.1, and now use towncrier to automatically generator the CHANGES.rst file from the change log entries. See https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format.

Would you please revert the change in this file, then add the following content to /news/1244.documentation? Then I'll merge. Thank you!

Suggested change
- Replace the RFC quotation in the docstring for :class:`vBoolean <icalendar.prop.boolean.vBoolean>` with a Pythonic description, including parsing behavior, a conformance reference, and a worked example. :issue:`1244`
Replaced the RFC quotation in the docstring for :class:`vBoolean <icalendar.prop.boolean.vBoolean>` with a Pythonic description, including parsing behavior, a conformance reference, and a working example. @tsai135

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, following the new change log process will resolve the merge conflicts, and we'll never have to deal with it again. YAY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants