Instead, I would use datetime.date() to make it clear that we are calculating the dates here, and use date.weekday() to get the current business day instead of using the .isocalendar() call, .isocalendar() us the day of the week to 0 (0 - Monday).
import datetime today = datetime.date(2013, 06, 26) dates = [today + datetime.timedelta(days=i) for i in range(0 - today.weekday(), 7 - today.weekday())]
Demo:
>>> from pprint import pprint >>> import datetime >>> today = datetime.date(2013, 06, 26) >>> pprint([today + datetime.timedelta(days=i) for i in range(0 - today.weekday(), 7 - today.weekday())]) [datetime.date(2013, 6, 24), datetime.date(2013, 6, 25), datetime.date(2013, 6, 26), datetime.date(2013, 6, 27), datetime.date(2013, 6, 28), datetime.date(2013, 6, 29), datetime.date(2013, 6, 30)]
On python 2, you can replace range() with xrange() if you want; for a 7-day value that will not matter much.
Just to make it explicit; datetime.weekday() exists and .isoweekday() , so there is no need to use .isocalendar() anywhere.