python datetime get yesterday

1
yesterday = datetime.date.fromordinal(datetime.date.today().toordinal()-1)

more on search4fan.github.io