Skip to content

Commit bf3f442

Browse files
committed
Makes list constants immutable (tuples)
1 parent 6dbc137 commit bf3f442

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

pendulum/constants.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,37 @@
5353

5454
# The number of seconds in an aligned 100-year chunk, for those that
5555
# do not begin with a leap year and those that do respectively.
56-
SECS_PER_100_YEARS = [
56+
SECS_PER_100_YEARS = (
5757
(76 * DAYS_PER_N_YEAR + 24 * DAYS_PER_L_YEAR) * SECS_PER_DAY,
58-
(75 * DAYS_PER_N_YEAR + 25 * DAYS_PER_L_YEAR) * SECS_PER_DAY,
59-
]
58+
(75 * DAYS_PER_N_YEAR + 25 * DAYS_PER_L_YEAR) * SECS_PER_DAY
59+
)
6060

6161
# The number of seconds in an aligned 4-year chunk, for those that
6262
# do not begin with a leap year and those that do respectively.
63-
SECS_PER_4_YEARS = [
63+
SECS_PER_4_YEARS = (
6464
(4 * DAYS_PER_N_YEAR + 0 * DAYS_PER_L_YEAR) * SECS_PER_DAY,
65-
(3 * DAYS_PER_N_YEAR + 1 * DAYS_PER_L_YEAR) * SECS_PER_DAY,
66-
]
65+
(3 * DAYS_PER_N_YEAR + 1 * DAYS_PER_L_YEAR) * SECS_PER_DAY
66+
)
6767

6868
# The number of seconds in non-leap and leap years respectively.
69-
SECS_PER_YEAR = [
69+
SECS_PER_YEAR = (
7070
DAYS_PER_N_YEAR * SECS_PER_DAY,
71-
DAYS_PER_L_YEAR * SECS_PER_DAY,
72-
]
71+
DAYS_PER_L_YEAR * SECS_PER_DAY
72+
)
7373

7474
# The month lengths in non-leap and leap years respectively.
75-
DAYS_PER_MONTHS = [
76-
[-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
77-
[-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
78-
]
75+
DAYS_PER_MONTHS = (
76+
(-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
77+
(-1, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
78+
)
7979

8080
# The day offsets of the beginning of each (1-based) month in non-leap
8181
# and leap years respectively.
8282
# For example, in a leap year there are 335 days before December.
83-
MONTHS_OFFSETS = [
84-
[-1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365],
85-
[-1, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]
86-
]
83+
MONTHS_OFFSETS = (
84+
(-1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365),
85+
(-1, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366)
86+
)
8787

8888
TM_SUNDAY = 0
8989
TM_MONDAY = 1

0 commit comments

Comments
 (0)