Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Change string to :class:str
As per ZeroIntenisities suggestion
  • Loading branch information
StanFromIreland authored Dec 10, 2024
commit 60b524fa9bedd8a25d3caa998c1f42512153f45c
24 changes: 12 additions & 12 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,41 +140,41 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is

.. method:: formatday(theday, weekday, width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string representing a single day formatted with the given width
which defaults to ``2``. If *theday* is ``0``, return a string of spaces of
Return a :class:`str` representing a single day formatted with the given width
which defaults to ``2``. If *theday* is ``0``, return a :class:`str` of spaces of
the specified width, representing an empty day. The *weekday* parameter
represents the day of the week, where ``0`` is Monday and ``6`` is Sunday.

.. method:: formatweek(theweek, width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string representing an entire week formatted with the given width for each day.
Return a :class:`str` representing an entire week formatted with the given width for each day.
The *theweek* parameter is a list of tuples, where each tuple contains a day of
the month or ``0`` for padding, and the corresponding weekday where ``0`` is
Monday and ``6`` is Sunday. Each day is padded to the specified width.

.. method:: formatweekday(weekday, width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string representing the name of a single weekday formatted to
Return a :class:`str` representing the name of a single weekday formatted to
the specified width. The *weekday* parameter is an integer representing
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
the day of the week, where ``0`` is Monday and ``6`` is Sunday.

.. method:: formatweekheader(width=2)
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

Return a string containing the header row of weekday names, formatted
Return a :class:`str` containing the header row of weekday names, formatted
with the given width for each column. The names depend on the locale
settings and are padded to the specified width.
Comment thread
StanFromIreland marked this conversation as resolved.

.. method:: formatmonth(theyear, themonth, w=0, l=0)

Return a month's calendar in a multi-line string. If *w* is provided, it
Return a month's calendar in a multi-line :class:`str`. If *w* is provided, it
specifies the width of the date columns, which are centered. If *l* is
given, it specifies the number of lines that each week will use. Depends
on the first weekday as specified in the constructor or set by the
:meth:`setfirstweekday` method.

.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)

Return a string representing the month's name centered within the
Return a :class:`str` representing the month's name centered within the
specified width. If *withyear* is ``True``, include the year in the
output. The *theyear* and *themonth* parameters specify the year
and month for the name to be formatted.
Expand All @@ -185,7 +185,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is

.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)

Return a *m*-column calendar for an entire year as a multi-line string.
Return a *m*-column calendar for an entire year as a multi-line :class:`str`.
Optional parameters *w*, *l*, and *c* are for date column width, lines per
week, and number of spaces between month columns, respectively. Depends on
the first weekday as specified in the constructor or set by the
Expand Down Expand Up @@ -396,7 +396,7 @@ For simple text calendars this module provides the following functions.

.. function:: month(theyear, themonth, w=0, l=0)

Returns a month's calendar in a multi-line string using the :meth:`~TextCalendar.formatmonth`
Returns a month's calendar in a multi-line :class:`str` using the :meth:`~TextCalendar.formatmonth`
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated
of the :class:`TextCalendar` class.


Expand All @@ -407,7 +407,7 @@ For simple text calendars this module provides the following functions.

.. function:: calendar(year, w=2, l=1, c=6, m=3)

Returns a 3-column calendar for an entire year as a multi-line string using
Returns a 3-column calendar for an entire year as a multi-line :class:`str` using
the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class.


Expand Down Expand Up @@ -468,7 +468,7 @@ The :mod:`calendar` module exports the following data attributes:

A sequence that represents the months of the year in the current locale. This
follows normal convention of January being month number 1, so it has a length of
13 and ``month_name[0]`` is the empty string.
13 and ``month_name[0]`` is the empty :class:`str`.
Comment thread
StanFromIreland marked this conversation as resolved.
Outdated

>>> import calendar
>>> list(calendar.month_name)
Expand All @@ -479,7 +479,7 @@ The :mod:`calendar` module exports the following data attributes:

A sequence that represents the abbreviated months of the year in the current
locale. This follows normal convention of January being month number 1, so it
has a length of 13 and ``month_abbr[0]`` is the empty string.
has a length of 13 and ``month_abbr[0]`` is the empty :class:`str`.

>>> import calendar
>>> list(calendar.month_abbr)
Expand Down