1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-12 23:40:10 +01:00

[utils] DateRange: Human readable __str__

This commit is contained in:
pukkandan 2024-01-31 15:57:37 +05:30
parent 7b50d71c59
commit 2369a2f8f6
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

View File

@ -1379,6 +1379,9 @@ class DateRange:
def __repr__(self):
return f'{__name__}.{type(self).__name__}({self.start.isoformat()!r}, {self.end.isoformat()!r})'
def __str__(self):
return f'{self.start} to {self.end}'
def __eq__(self, other):
return (isinstance(other, DateRange)
and self.start == other.start and self.end == other.end)