pytoml
pytoml copied to clipboard
Datetimes are not timezone aware
Since the timezone is specified in the parsed datetime, the datetime should have the timezone (UTC) specified.
Not sure about this, because in the context of TOML, every timestamp value is assured to be Z. So it feels right for the tzinfo of our datetime objects to be singleton, i.e., locked to None.
For some perspective, PyYAML does the same:
>>> import yaml
>>> print yaml.load('- 2001-12-15T02:59:23Z')[0].tzinfo
None
I can understand your hesitation. If you read this and you still think that assuming UTC is correct, then feel free to close this. I just try to avoid naive datetimes as much as possible.