Hacker News new | past | comments | ask | show | jobs | submit login

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.




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.


> 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


Ok, let me take this a bit more seriously. What "pythonic" principles does the existing API maintain that the proposed "crap API" disregards?




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: