<p>The Python <a href="http://www.python.org/doc/2.5.2/lib/datetime-datetime.html" rel="noreferrer"><code>datetime.isocalendar()</code></a> method returns a tuple <code>(ISO_year, ISO_week_number, ISO_weekday)</code> for the given <code>datetime</code> object.  Is there a corresponding inverse function?  If not, is there an easy way to compute a date given a year, week number and day of the week?</p>

EDIT: ignore this, the edge cases are a pain. Go with Ben's solution.
Ok, on closer inspection I noticed that
```
strptime
```
has
```
%W
```
and
```
%w
```
parameters, so the following works:
```
```
def fromisocalendar(y,w,d):
   return datetime.strptime( "%04dW%02d-%d"%(y,w-1,d), "%YW%W-%w")
```
```
A couple of gotchas: The ISO week number starts at
```
1
```
, while
```
%W
```
starts at
```
0
```
.  The ISO week day starts at
```
1
```
(Monday), which is the same as
```
%w
```
, so Sunday would probably have to be
```
0
```
, not
```
7
```
...