4 ms·
This sounds like turning a good API into an unreadable mess. And no, it is not pythonic No, most people do want to compare times in different TZs without the e
by raverbashing 4y ago
This sounds like turning a good API into an unreadable mess. And no, it is not pythonic
No, most people do want to compare times in different TZs without the extra cruft.
- sanderjd 4y agoIt would be turning a really bad API that is a constant source of errors into a slightly better and less error prone API. It's totally possible that "pythonic" means "error prone", but that would not be something to tout proudly if so. I think a better API would be to have a different types for timezone- naive vs. aware datetimes, and a canonical way to convert either of those types into an instant in time (requiring a timezone be attached for the naive type). Then the instants in time could be compared with the equals operator without confusion.
- raverbashing 4y ago> It's totally possible that "pythonic" means "error prone" Those who say that don't know what it means. And given how much I have to deal with crap APIs that disregard those principles it's safe to ignore discussions leading elsewhere
- sanderjd 4y agoOk, let me take this a bit more seriously. What "pythonic" principles does the existing API maintain that the proposed "crap API" disregards?