@@ -131,8 +131,8 @@ def _zero_to_df(
131
131
132
132
def _df_to_zero (
133
133
self ,
134
- dfs : float | np .ndarray ,
135
- maturity_dts : Date | list ,
134
+ dfs : ( float , np .ndarray ) ,
135
+ maturity_dts : ( Date , list ) ,
136
136
freq_type : FrequencyTypes ,
137
137
dc_type : DayCountTypes ,
138
138
):
@@ -183,7 +183,7 @@ def _df_to_zero(
183
183
184
184
def zero_rate (
185
185
self ,
186
- dts : list | Date ,
186
+ dts : ( list , Date ) ,
187
187
freq_type : FrequencyTypes = FrequencyTypes .CONTINUOUS ,
188
188
dc_type : DayCountTypes = DayCountTypes .ACT_360 ,
189
189
):
@@ -210,7 +210,7 @@ def zero_rate(
210
210
211
211
###########################################################################
212
212
213
- def cc_rate (self , dts : list | Date , dc_type : DayCountTypes = DayCountTypes .SIMPLE ):
213
+ def cc_rate (self , dts : ( list , Date ) , dc_type : DayCountTypes = DayCountTypes .SIMPLE ):
214
214
"""Calculation of zero rates with continuous compounding. This
215
215
function can return a vector of cc rates given a vector of
216
216
dates so must use Numpy functions."""
@@ -295,7 +295,7 @@ def swap_rate(
295
295
296
296
###########################################################################
297
297
298
- def df (self , dt : list | Date , day_count = DayCountTypes .ACT_ACT_ISDA ):
298
+ def df (self , dt : ( list , Date ) , day_count = DayCountTypes .ACT_ACT_ISDA ):
299
299
"""Function to calculate a discount factor from a date or a
300
300
vector of dates. The day count determines how dates get converted to
301
301
years. I allow this to default to ACT_ACT_ISDA unless specified."""
@@ -310,7 +310,7 @@ def df(self, dt: list | Date, day_count=DayCountTypes.ACT_ACT_ISDA):
310
310
311
311
###########################################################################
312
312
313
- def _df (self , t : float | np .ndarray ):
313
+ def _df (self , t : ( float , np .ndarray ) ):
314
314
"""Hidden function to calculate a discount factor from a time or a
315
315
vector of times. Discourage usage in favour of passing in dates."""
316
316
@@ -368,7 +368,7 @@ def fwd(self, dts: Date):
368
368
369
369
###########################################################################
370
370
371
- def _fwd (self , times : np .ndarray | float ):
371
+ def _fwd (self , times : ( np .ndarray , float ) ):
372
372
"""Calculate the continuously compounded forward rate at the forward
373
373
time provided. This is done by perturbing the time by a small amount
374
374
and measuring the change in the log of the discount factor divided by
0 commit comments