Skip to content

docs: correct the default ISO weekday in isoparse - #1630

Open
tongwentao wants to merge 2 commits into
dateutil:masterfrom
tongwentao:docs/isoparse-default-weekday
Open

tongwentao wants to merge 2 commits into
dateutil:masterfrom
tongwentao:docs/isoparse-default-weekday

Conversation

@tongwentao

Copy link
Copy Markdown

Closes #1629.

Correct the isoparse docstring to say an ISO week without an explicit weekday defaults to 1, Monday. The previous wording said 0, although the parser uses dayno = 1 and rejects day 0. No parsing behavior changes.

Validation on Python 3.11.15:

  • Existing ISO parser suite: 567 passed, 1 xfailed.
  • Confirmed extended/basic week-only inputs match the explicit Monday form, including a week crossing the calendar-year boundary; day 0 still raises ValueError.
  • Full Sphinx HTML build with -W passed; the rendered parser page contains the corrected default.
  • git diff --check passed.

Prepared and validated with Codex.

@Upua

Upua commented Oct 22, 2026

Copy link
Copy Markdown

Confirmed at this branch's head: src/dateutil/parser/isoparser.py:80 now reads "ISO week (day defaults to 1, Monday)", and isoparse('2024-W01') == isoparse('2024-W01-1') (2024-01-01) as before; the change is documentation and the changelog entry only, no parsing behaviour touched. Thanks for picking it up so quickly.

This branch has not been deployed

No deployments
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.

isoparse docstring says an ISO week without a day "defaults to 0", but the day is 1 (Monday) and 0 is rejected

2 participants