MCPcopy
hub / github.com/celery/celery / is_naive

Function is_naive

celery/utils/time.py:327–329  ·  view source on GitHub ↗

Return True if :class:`~datetime.datetime` is naive, meaning it doesn't have timezone info set.

(dt: datetime)

Source from the content-addressed store, hash-verified

325
326
327def is_naive(dt: datetime) -> bool:
328 """Return True if :class:`~datetime.datetime` is naive, meaning it doesn't have timezone info set."""
329 return dt.tzinfo is None or dt.tzinfo.utcoffset(dt) is None
330
331
332def _can_detect_ambiguous(tz: tzinfo) -> bool:

Callers 4

to_localMethod · 0.85
to_local_fallbackMethod · 0.85
localizeFunction · 0.85
maybe_make_awareFunction · 0.85

Calls 1

utcoffsetMethod · 0.45

Tested by

no test coverage detected