Move prop.py as __init__.py into a directory

pull/877/head
Nicco Kunzmann 2025-09-17 11:59:51 +01:00
rodzic b4d6614b38
commit 776dc2b7a7
2 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -184,7 +184,7 @@ extend-safe-fixes = [
"N999", # module name
"PT027", # assertRaises
]
"src/icalendar/prop.py" = [
"src/icalendar/prop/__init__.py" = [
"N801", # Class name should use CamelCase
]
"src/icalendar/fuzzing/*" = [

Wyświetl plik

@ -717,6 +717,17 @@ class vDDDTypes(TimeBase):
return vTime.from_ical(ical)
raise ValueError(f"Expected datetime, date, or time. Got: '{ical}'")
@property
def td(self) -> timedelta:
"""Compatibility property returning self.dt.
This class is used to replace different time components.
Some of them contain a datetime or date (.dt).
Some of them contain a timedelta (.td).
This property allows interoperability.
"""
return self.dt
class vDate(TimeBase):
"""Date