Skip to content

Add type hints to vDDDTypes.from_ical - #2158

Open
sneha-shukla-dev wants to merge 1 commit into
PyCalendar:mainfrom
sneha-shukla-dev:docs/938-vdddtypes-from-ical-type-hints
Open

sneha-shukla-dev wants to merge 1 commit into
PyCalendar:mainfrom
sneha-shukla-dev:docs/938-vdddtypes-from-ical-type-hints

Conversation

@sneha-shukla-dev

Copy link
Copy Markdown

Linked issue

Description

This adds type annotations to vDDDTypes.from_ical in src/icalendar/prop/dt/types.py. The implementation already accepts a string or an existing vDDDTypes instance, forwards an optional timezone name or tzinfo to the sibling parsers, and returns a DT_TYPE value. Those types are now on the signature, consistent with annotated methods such as vTime.from_ical.

I did not change behavior. I also avoided src/icalendar/prop/dt/list.py, as requested for this issue, and I did not annotate vDuration.from_ical because open pull request #1873 already edits that function.

Open pull requests #2153 and #2132 also edit src/icalendar/prop/dt/types.py, but they change _get_value and the from_xcal docstrings, not from_ical. See #2153 and #2132.

I used an AI assistant (Grok Bot) to help find an untyped function that was not already covered by an open pull request, confirm the types from the implementation, call sites, and tests, and prepare the changelog entry and this pull request description.

Checklist

  • I added a change log entry, following the instructions in all subsections under Change log requirements.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages, if applicable.
  • I added or updated tests, if applicable.
  • I ran and ensured all tests pass locally by following Run tests.
  • I added or edited documentation as necessary, both as docstrings to be rendered in the API documentation and narrative documentation, following the Style guide.

Additional information

Existing tests were sufficient, so I did not add new ones. I ran ruff format --check and ruff check on src/icalendar/prop/dt/types.py, pytest src/icalendar/tests/prop/test_vDDDTypes.py src/icalendar/tests/test_period.py src/icalendar/tests/test_pytz_zoneinfo_integration.py (2534 passed, 4 skipped), and pytest -k "vDDDTypes or DDDTypes or from_ical" excluding fuzz tests (795 passed, 1 skipped, 20 xfailed). I did not run the full tox matrix.

The changelog fragment is news/938.chore.14.

Annotate the ical argument as a string or existing vDDDTypes instance,
the optional timezone as a name, tzinfo, or None, and the return value
as DT_TYPE, matching the implementation and sibling from_ical methods.

AI disclosure:
I used an AI assistant (Grok Bot) to help find a function that still
needed type hints for issue PyCalendar#938, that was not already covered by an
open pull request, confirm the types from the implementation, call
sites, and tests, and prepare the changelog entry.
Prompts summarized: search src/icalendar for untyped functions outside
files and exact functions in open PyCalendar#938 (and related) pull requests;
avoid prop/dt/list.py and vDuration.from_ical (open PR PyCalendar#1873); annotate
vDDDTypes.from_ical; add news/938.chore.14 with the required AI
disclosure.
Output: this commit.
@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

One or more PR-quality checks did not pass. Review the PR Quality Checks summary in the workflow run for the failed checks and their details, then make any necessary updates.

Checklist items may remain unchecked while work is in progress. Please tick each item as you complete it.

If you used AI assistance, follow the project's Responsible AI use policy and provide the required disclosures.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @sneha-shukla-dev! A maintainer will review it shortly.

@github-actions

Copy link
Copy Markdown
Contributor

Insufficient data

Not enough activity yet to make a reliable assessment.

View full analysis →

Evidence
  • Recently created: Account is 0 days old

This is an automated analysis by AgentScan

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

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant