.. function:: prcal(year, w=0, l=0, c=6, m=3)
.. function:: calendar(year, w=2, l=1, c=6, m=3)
>>> import calendar, inspect
>>> inspect.signature(calendar.calendar)
<Signature (theyear, w=2, l=1, c=6, m=3)>
>>> inspect.signature(calendar.prcal)
<Signature (theyear, w=0, l=0, c=6, m=3)>
Documentation
The module-level functions
calendar.calendar()andcalendar.prcal()document their first parameter asyear:However, both are bound methods of the module's
TextCalendarinstance (calendar = c.formatyear,prcal = c.pryearinLib/calendar.py), whose first parameter is namedtheyear:>>> import calendar, inspect >>> inspect.signature(calendar.calendar) <Signature (theyear, w=2, l=1, c=6, m=3)> >>> inspect.signature(calendar.prcal) <Signature (theyear, w=0, l=0, c=6, m=3)>As a result the documented keyword name does not work —
calendar.calendar(year=2025)raisesTypeError, whilecalendar.calendar(theyear=2025)succeeds.The documentation should be updated to use the real parameter name
theyear, which also matches the siblingmonth()andprmonth()functions documented just above.Linked PRs
calendar.calendarandcalendar.prcal#153927calendar.calendarandcalendar.prcal(GH-153927) #153937calendar.calendarandcalendar.prcal(GH-153927) #153938calendar.calendarandcalendar.prcal(GH-153927) #153939