@@ -827,7 +827,7 @@ def replace(self, year=None, month=None, day=None):
827827 month = self ._month
828828 if day is None :
829829 day = self ._day
830- return date (year , month , day )
830+ return type ( self ) (year , month , day )
831831
832832 # Comparisons of date objects with other.
833833
@@ -1315,7 +1315,7 @@ def replace(self, hour=None, minute=None, second=None, microsecond=None,
13151315 tzinfo = self .tzinfo
13161316 if fold is None :
13171317 fold = self ._fold
1318- return time (hour , minute , second , microsecond , tzinfo , fold = fold )
1318+ return type ( self ) (hour , minute , second , microsecond , tzinfo , fold = fold )
13191319
13201320 # Pickle support.
13211321
@@ -1596,7 +1596,7 @@ def replace(self, year=None, month=None, day=None, hour=None,
15961596 tzinfo = self .tzinfo
15971597 if fold is None :
15981598 fold = self .fold
1599- return datetime (year , month , day , hour , minute , second ,
1599+ return type ( self ) (year , month , day , hour , minute , second ,
16001600 microsecond , tzinfo , fold = fold )
16011601
16021602 def _local_timezone (self ):
0 commit comments