@@ -88,7 +88,9 @@ def from_nonstandard_string(cls, point_string):
88
88
89
89
def add (self , other ):
90
90
"""Add an Interval to self."""
91
- return ISO8601Point (self ._iso_point_add (self .value , other .value ))
91
+ return ISO8601Point (self ._iso_point_add (
92
+ self .value , other .value , CALENDAR .mode
93
+ ))
92
94
93
95
def standardise (self ):
94
96
"""Reformat self.value into a standard representation."""
@@ -106,41 +108,43 @@ def standardise(self):
106
108
def sub (self , other ):
107
109
"""Subtract a Point or Interval from self."""
108
110
if isinstance (other , ISO8601Point ):
109
- return ISO8601Interval (
110
- self ._iso_point_sub_point (self .value , other .value ))
111
- return ISO8601Point (
112
- self ._iso_point_sub_interval (self .value , other .value ))
111
+ return ISO8601Interval (self ._iso_point_sub_point (
112
+ self .value , other .value , CALENDAR .mode
113
+ ))
114
+ return ISO8601Point (self ._iso_point_sub_interval (
115
+ self .value , other .value , CALENDAR .mode
116
+ ))
113
117
114
118
@staticmethod
115
119
@lru_cache (10000 )
116
- def _iso_point_add (point_string , interval_string ):
120
+ def _iso_point_add (point_string , interval_string , _calendar_mode ):
117
121
"""Add the parsed point_string to the parsed interval_string."""
118
122
point = point_parse (point_string )
119
123
interval = interval_parse (interval_string )
120
124
return str (point + interval )
121
125
122
126
def _cmp (self , other : 'ISO8601Point' ) -> int :
123
- return self ._iso_point_cmp (self .value , other .value )
127
+ return self ._iso_point_cmp (self .value , other .value , CALENDAR . mode )
124
128
125
129
@staticmethod
126
130
@lru_cache (10000 )
127
- def _iso_point_cmp (point_string , other_point_string ):
131
+ def _iso_point_cmp (point_string , other_point_string , _calendar_mode ):
128
132
"""Compare the parsed point_string to the other one."""
129
133
point = point_parse (point_string )
130
134
other_point = point_parse (other_point_string )
131
135
return cmp (point , other_point )
132
136
133
137
@staticmethod
134
138
@lru_cache (10000 )
135
- def _iso_point_sub_interval (point_string , interval_string ):
139
+ def _iso_point_sub_interval (point_string , interval_string , _calendar_mode ):
136
140
"""Return the parsed point_string minus the parsed interval_string."""
137
141
point = point_parse (point_string )
138
142
interval = interval_parse (interval_string )
139
143
return str (point - interval )
140
144
141
145
@staticmethod
142
146
@lru_cache (10000 )
143
- def _iso_point_sub_point (point_string , other_point_string ):
147
+ def _iso_point_sub_point (point_string , other_point_string , _calendar_mode ):
144
148
"""Return the difference between the two parsed point strings."""
145
149
point = point_parse (point_string )
146
150
other_point = point_parse (other_point_string )
0 commit comments