import datetime
dat = {21: 'data', 11: 'HI', 2: ' Join', 424: 'teg42 '}
today = datetime.date.today()
for i in dat:
if isinstance(i, datetime.date): # условие сравнения классов
continue
else :
tod = today + datetime.timedelta(days=i)
dat[tod] = dat.pop(i)
print(dat)
{2: ' Join', 424: 'teg42 ', datetime.date(2021, 3, 11): 'data', datetime.date(2021, 3, 1): 'HI'}
import datetime
dat = {21: 'data', 11: 'HI', 2: ' Join', 424: 'teg42 '}
today = datetime.date.today()
dat = {today+datetime.timedelta(days=k):v for k,v in dat.items()}
print(dat)