diff --git a/news/938.chore.14 b/news/938.chore.14 new file mode 100644 index 000000000..85aedf7a1 --- /dev/null +++ b/news/938.chore.14 @@ -0,0 +1 @@ +Added type annotations to :meth:`~icalendar.prop.dt.types.vDDDTypes.from_ical`. I used an AI assistant (Grok Bot) to help locate an untyped function not already covered by an open pull request, confirm the argument and return types from the implementation and tests, and prepare this changelog entry. @sneha-shukla-dev diff --git a/src/icalendar/prop/dt/types.py b/src/icalendar/prop/dt/types.py index bad267e01..736586ac4 100644 --- a/src/icalendar/prop/dt/types.py +++ b/src/icalendar/prop/dt/types.py @@ -3,7 +3,7 @@ from __future__ import annotations from collections.abc import Sequence -from datetime import date, datetime, time, timedelta +from datetime import date, datetime, time, timedelta, tzinfo from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias from icalendar.caselessdict import CaselessDict @@ -94,7 +94,9 @@ def to_ical(self) -> bytes: return self.to_property_type().to_ical() @classmethod - def from_ical(cls, ical, timezone=None): + def from_ical( + cls, ical: str | Self, timezone: str | tzinfo | None = None + ) -> DT_TYPE: if isinstance(ical, cls): return ical.dt u = ical.upper()