Skip to content

Navigation Menu

Sign in
Sign up

Fix broken doc links in Calendar.new docstring #1732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Mohammed-Ahmed7 wants to merge 1 commit into collective:main
base: main
Choose a base branch
Loading
from Mohammed-Ahmed7:fix/calendar-doc-links
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

10 changes: 10 additions & 0 deletions news/1158.documentation
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Fixed two broken documentation cross-reference links in the
:meth:`~icalendar.cal.calendar.Calendar.new` docstring: the
:class:`~icalendar.cal.availability.Availability` class reference
was missing its full module path, and the ``DEFAULT_PRODID``
reference pointed to an undocumented module-level constant and
was changed to plain code formatting instead.

I used AI to assist me with this change.

@Mohammed-Ahmed7
Comment on lines +1 to +10

@stevepiercy stevepiercy Aug 28, 2026

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.

Please put this on a single line, and update it to reflect the suggestions below.

4 changes: 2 additions & 2 deletions src/icalendar/cal/calendar.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def journals(self) -> list[Journal]:

@property
def availabilities(self) -> list[Availability]:
"""All :class:`Availability` components in the calendar.
"""All :class:`Availability <icalendar.cal.availability.Availability>` components in the calendar.

@stevepiercy stevepiercy Aug 28, 2026

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.

See the "object only" syntax example at https://icalendar.readthedocs.io/en/latest/contribute/documentation/style-guide.html#cross-reference-python-objects.

Suggested change
"""All :class:`Availability <icalendar.cal.availability.Availability>` components in the calendar.
"""All :class:`~icalendar.cal.availability.Availability` components in the calendar.


This is a shortcut to get all availabilities.
Modifications do not change the calendar.
Expand Down Expand Up @@ -566,7 +566,7 @@ def new(
prodid: The :attr:`prodid` of the component. If ``None`` and ``organization`` is provided,
generates a `prodid` in the format of "-//organization//name//language".
If ``None`` and ``organization`` is not provided, sets it to
:attr:`~icalendar.cal.calendar.DEFAULT_PRODID`.
``DEFAULT_PRODID``.

@stevepiercy stevepiercy Aug 28, 2026

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.

Please revert this change, and see my suggestion above.

https://github.com/collective/icalendar/pull/1732/changes#r3879155959

refresh_interval: The :attr:`refresh_interval` of the calendar.
refids: :attr:`~icalendar.cal.component.Component.refids` of the calendar.
related_to: :attr:`~icalendar.cal.component.Component.related_to` of the calendar.
Expand Down

AltStyle によって変換されたページ (->オリジナル) /