>>> import calendar
>>> calendar.setfirstweekday(weekday=calendar.SUNDAY)
Traceback (most recent call last):
...
TypeError: setfirstweekday() got an unexpected keyword argument 'weekday'
>>> calendar.setfirstweekday(firstweekday=calendar.SUNDAY) # OK
Documentation
https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday documents the module-level function as
setfirstweekday(weekday), but the implementation inLib/calendar.pyisdef setfirstweekday(firstweekday). The parameter can be passed by keyword, so the documented signature fails:The fix is to change the documented signature to
setfirstweekday(firstweekday), matching the code and the already-correctCalendar.setfirstweekday(firstweekday)entry in the same document. I have a PR ready: #153851.Linked PRs