-
-
Notifications
You must be signed in to change notification settings - Fork 412
Closed
Description
Checks:
-
I am on the latest Pendulum version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
OS version and name: MacOS Ventura 13.4 (22F66)
-
** Python Version** '3.9.16 (main, Feb 14 2023, 12:36:00) \n[Clang 14.0.0 (clang-1400.0.29.202)]'
-
Pendulum version: 2.1.2
Issue
When a Duration object with a month attribute copied using copy.deepcopy, the result is a Duration that has day-based intervals instead of month-based intervals.
Repro:
from copy import deepcopy
from pendulum.datetime import DateTime
from pendulum.duration import Duration
cycle_interval = Duration(months=1)
cycle_interval
# Duration(months=1)
copy_attempt = deepcopy(Duration(months=1))
copy_attempt
# Duration(weeks=4, days=2)
I would expect copy_attempt to also be a Duration(months=1)
kpamaran
Metadata
Metadata
Assignees
Labels
No labels