Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/1930.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github handle: fishingpoleroid. AI Disclosure: Claude Opus 5.5 was used to locate functions missing type-hints. Added type hints to vRecur class.
6 changes: 3 additions & 3 deletions src/icalendar/prop/recur/recur.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ def to_ical(self):
return b";".join(result)

@classmethod
def parse_type(cls, key, values):
def parse_type(cls, key: str, values: str) -> list[Any]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this could be list[VPROPERTY] could you check?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe .from_ical() method returns python primitives. List[Any] would be appropriate here.

# integers
key = cls._normalize_key(key)
parser = cls.types.get(key, vText)
return [parser.from_ical(v) for v in values.split(",")]

@classmethod
def from_ical(cls, ical: str):
def from_ical(cls, ical: str) -> Self:
if isinstance(ical, cls):
return ical
try:
Expand All @@ -271,7 +271,7 @@ def examples(cls) -> list[Self]:

from icalendar.param import VALUE

def to_jcal(self, name: str) -> list:
def to_jcal(self, name: str) -> list[Any]:
"""The jCal representation of this property according to :rfc:`7265`."""
recur = {}
for k, v in self._normalized().sorted_items():
Expand Down
Loading