Repository navigation
Add type hints to vDDDTypes.from_ical - #2158
Open
sneha-shukla-dev wants to merge 1 commit into
Open
sneha-shukla-dev wants to merge 1 commit into
sneha-shukla-dev wants to merge 1 commit into
Conversation
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.
sneha-shukla-dev
requested review from
angatha,
niccokunzmann and
stevepiercy
as code owners
November 19, 2026 11:44
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. |
Contributor
|
Thanks for the pull request, @sneha-shukla-dev! A maintainer will review it shortly. |
Contributor
Insufficient dataNot enough activity yet to make a reliable assessment. Evidence
This is an automated analysis by AgentScan |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Description
This adds type annotations to
vDDDTypes.from_icalinsrc/icalendar/prop/dt/types.py. The implementation already accepts a string or an existingvDDDTypesinstance, forwards an optional timezone name ortzinfoto the sibling parsers, and returns aDT_TYPEvalue. Those types are now on the signature, consistent with annotated methods such asvTime.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 annotatevDuration.from_icalbecause 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_valueand thefrom_xcaldocstrings, notfrom_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
Additional information
Existing tests were sufficient, so I did not add new ones. I ran
ruff format --checkandruff checkonsrc/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), andpytest -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.