this routine and gcdex appear to be doing the same thing but returning results in different orders. It would be easier to unify later (perhaps by giving Rational or Integer a gcdex method) if you followed the existing convetion in terms of order:

```
>>> extended_euclid(3,4)
(1, -1, 1)
>>> gcdex(3,4)
(-1, 1, 1)
>>> extended_euclid(4,12)
(4, 1, 0)
>>> gcdex(4,12)
(1, 0, 4)
```

Your routine is much faster, however:

```
>>> t=time();jnk=[gcdex(randint(1,1000),randint(1,1000)) for i in range(1000)];time()-t
0.75199985504150391
>>> t=time();jnk=[extended_euclid(randint(1,1000),randint(1,1000)) for i in range(1000)];time()-t
0.020999908447265625
```

Perhaps this should be named `igcdex`?