2 ms·
It 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"
by sanderjd 4y ago
It 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?