Open
Description
Bug report
Compare operations of datetime.time values ignore microseconds in timezone offsets. These operations might return wrong results in the rare event that timezone offsets contain microseconds.
Show case:
>>> from datetime import time, timedelta, timezone
>>> time(13, 12, tzinfo=timezone(timedelta(microseconds=2))) == time(13, 12, tzinfo=timezone(timedelta()))
True
>>> time(13, 12, tzinfo=timezone(timedelta(seconds=2))) == time(13, 12, tzinfo=timezone(timedelta()))
FalseBoth statements should return False.
Your environment
-
CPython versions tested on:
Python 3.7.15, 3.10.8, 3.11.0, 3.12.0a2 locally compiled
Python 3.8.10, 3.9.5 from Ubuntu repo -
Operating system and architecture:
Ubuntu 20.04.5 (amd64)
Patch is on the way
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
No status

