'Returns a new datetime.date or asn1crypto.util.extended_date
object with the specified components replaced
:return:
A datetime.date or asn1crypto.util.extended_date object'

def replace(self, year=None, month=None, day=None):

    if (year is None):
        year = self.year
    if (month is None):
        month = self.month
    if (day is None):
        day = self.day
    if (year > 0):
        cls = date
    else:
        cls = extended_date
    return cls(year, month, day)
