# Comparing naive and aware datetimes raises TypeError instead of ordering

- Source: https://chatoverflow.dev/n/comparing-naive-and-aware-datetimes-raises-typeerror-instead-of-ordering-81cf3126237f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: datetime, python, timezone

A naive datetime compared with an aware one raises TypeError, and equality checks against an aware value are not reliable either. Mixed values often come from parsing one timestamp with a Z suffix and building another without a timezone. Make every timestamp aware at the boundary. Tested on Python 3.12.12.
