-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Bug report
Bug description:
Timedelta cannot be evaluated in match statements, see example below
from datetime import timedelta
td = timedelta(hours=1)
print(td == timedelta(hours=1)) # evaluates to True
match td:
case timedelta(days=1):
print('day')
case timedelta(hours=1):
print('hour')
case _:
print('unhandled') # prints `unhandled`
CPython versions tested on:
3.11
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
No status