this post was submitted on 18 Nov 2023
66 points (98.5% liked)
Python
6368 readers
16 users here now
Welcome to the Python community on the programming.dev Lemmy instance!
π Events
Past
November 2023
- PyCon Ireland 2023, 11-12th
- PyData Tel Aviv 2023 14th
October 2023
- PyConES Canarias 2023, 6-8th
- DjangoCon US 2023, 16-20th (!django π¬)
July 2023
- PyDelhi Meetup, 2nd
- PyCon Israel, 4-5th
- DFW Pythoneers, 6th
- Django Girls Abraka, 6-7th
- SciPy 2023 10-16th, Austin
- IndyPy, 11th
- Leipzig Python User Group, 11th
- Austin Python, 12th
- EuroPython 2023, 17-23rd
- Austin Python: Evening of Coding, 18th
- PyHEP.dev 2023 - "Python in HEP" Developer's Workshop, 25th
August 2023
- PyLadies Dublin, 15th
- EuroSciPy 2023, 14-18th
September 2023
- PyData Amsterdam, 14-16th
- PyCon UK, 22nd - 25th
π Python project:
- Python
- Documentation
- News & Blog
- Python Planet blog aggregator
π Python Community:
- #python IRC for general questions
- #python-dev IRC for CPython developers
- PySlackers Slack channel
- Python Discord server
- Python Weekly newsletters
- Mailing lists
- Forum
β¨ Python Ecosystem:
π Fediverse
Communities
- #python on Mastodon
- c/django on programming.dev
- c/pythorhead on lemmy.dbzer0.com
Projects
- PythΓΆrhead: a Python library for interacting with Lemmy
- Plemmy: a Python package for accessing the Lemmy API
- pylemmy pylemmy enables simple access to Lemmy's API with Python
- mastodon.py, a Python wrapper for the Mastodon API
Feeds
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yeah, the names imply that those should be TZ aware. Though I can understand the reasoning, as this change can silently break already broken code that kind of works, and would be a nightmare to fix in a large codebase.
I also disagree with author, about naive datetime. I don't think there is a good use case for them, and people who use them, do so because they are not aware of the issues.
The only argument I saw was for micro performance improvements, which is kind of funny to care about when programming in python. Since it is implemented in C, the code removing the timezone likely takes more resources.
While it would be ideal to have all datetime fields in databases and other data stores be time zone aware, that is certainly not the case. Also, SQLite (and probably others) do not have great support for time zones and it's recommended to store datetimes as UTC (typically unix timestamps).
Deprecating
utcnow
was a good idea, but they should have replaced it withnaive_utcnow
. Oh well.Timezones are a disease and should be eradicated. I will die on this hill.
Agreed. I'm an American and wish we could just all be on UTC. Yeah, my workday would start at like 0200, but that's a sacrifice I'm willing to make.
Everyone on UTC sounds like such a great idea that would solve so many problems.
Unfortunately humans are so dependent on daylight and the day night cycle that it will never work
@Sigmatics you can have everyone on the same time zone and still have different day/night cycles. It just means you have to get up at 14:00 and go to sleep at 5:00. The big problem with this is that the date-switch happens for everyone at the same time, which means you might have breakfast on Thursday and lunch on Friday. That makes it terribly inconvenient, and therefore probably unviable.
Yeah that's kind of what I meant. People like their days to start at the same time every day. We are creatures of habit.
@Sigmatics Habits can be unlearned over a few generations. Doesn't mean in becomes practical all if a sudden. It's just messy to say "I'll do this tomorrow" when "tomorrow" might mean "before I go to bed".
"See you Monday!"
"Eh, before or after sleep on Monday?"
It's just not viable. It requires us to think differently about what a date is, returning the original issue: different people living at different dates.
I agree. I hate timezones so much
@BeardedGingerWonder will you adapt your time to be 7 hours later?
Thought so.
You thought what?
I agree.
The only use I can see for naive date times is you just read the date out of an old sql database, but it shouldn't leave the function naive, it should be converted first.
Python's timezone handling is probably my only complaint about the language. I shouldn't need to use libraries just to have timezones.