Created
March 3, 2021 21:55
-
-
Save MartinThoma/b01ca0871e5a0eadfb0bb6ea6b351481 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def __post_init__(self): | |
| if not (-180 <= self.longitude <= 180): | |
| v = self.longitude | |
| raise ValueError(f"Longitude was {v}, but must be in [-180, +180]") | |
| if not (-90 <= self.latitude <= 90): | |
| v = self.latitude | |
| raise ValueError(f"Latitude was {v}, but must be in [-90, +90]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment