- commit
- 04c42b2137211fc1b49503ea53c9b016f29b9ace
- parent
- 32c42a05751a83b9cbb12054297c0a32aca03b18
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2024-08-31 08:28
runtime validation
Diffstat
| M | nominaldelta.py | 4 | ++++ |
1 files changed, 4 insertions, 0 deletions
diff --git a/nominaldelta.py b/nominaldelta.py
@@ -77,6 +77,10 @@ class NominalDelta: 77 77 minutes: int = 0, 78 78 seconds: float = 0, 79 79 ): -1 80 for key in ['years', 'months', 'weeks', 'days', 'hours', 'minutes']: -1 81 if not isinstance(locals()[key], int): -1 82 raise ValueError(f'{key} must be an int') -1 83 80 84 self.months = years * 12 + months 81 85 self.days = weeks * 7 + days 82 86 self.seconds = hours * 3600 + minutes * 60 + seconds