@@ -747,11 +747,13 @@ cdef class BaseOffset:
747
747
self .__dict__ .update(state)
748
748
749
749
if ' weekmask' in state and ' holidays' in state:
750
- calendar, holidays = _get_calendar(weekmask = self .weekmask,
751
- holidays = self .holidays,
750
+ weekmask = state.pop(" weekmask" )
751
+ holidays = state.pop(" holidays" )
752
+ calendar, holidays = _get_calendar(weekmask = weekmask,
753
+ holidays = holidays,
752
754
calendar = None )
753
- object . __setattr__ ( self , " calendar" , calendar)
754
- object . __setattr__ ( self , " holidays" , holidays)
755
+ self . calendar = calendar
756
+ self . holidays = holidays
755
757
756
758
def __getstate__ (self ):
757
759
""" Return a pickleable state"""
@@ -1043,9 +1045,12 @@ cdef class BusinessMixin(SingleConstructorOffset):
1043
1045
BaseOffset.__setstate__(self , state)
1044
1046
1045
1047
1046
- class BusinessHourMixin (BusinessMixin ):
1048
+ cdef class BusinessHourMixin(BusinessMixin):
1047
1049
_adjust_dst = False
1048
1050
1051
+ cdef readonly:
1052
+ tuple start, end
1053
+
1049
1054
def __init__ (
1050
1055
self , n = 1 , normalize = False , start = " 09:00" , end = " 17:00" , offset = timedelta(0 )
1051
1056
):
@@ -1092,8 +1097,8 @@ class BusinessHourMixin(BusinessMixin):
1092
1097
" one another"
1093
1098
)
1094
1099
1095
- object . __setattr__ ( self , " start" , start)
1096
- object . __setattr__ ( self , " end" , end)
1100
+ self . start = start
1101
+ self . end = end
1097
1102
1098
1103
def __reduce__ (self ):
1099
1104
return type (self ), (self .n, self .normalize, self .start, self .end, self .offset)
0 commit comments