PEP 303: Extend divmod() for Multiple Divisors

Anders J. Munch andersjm at dancontrol.dk
Thu Jan 2 09:49:13 EST 2003


"Anton Vredegoor" <anton at vredegoor.doge.nl> wrote:
> Here's the short permutation algorithm for PEP 303:
> 
> def perm(i,s):
>     L = list(s)
>     return "".join([L.pop(x) for x in\
>         divmod(i,*range(len(L)-1,0,-1))])

<Cognitive overload. Core dumped.>

-0.1 on PEP303.

It's a pure and elegant extension, but it suspect it will be so rarely
used that it will effectively become an obfuscation device ;-).

- Anders






More information about the Python-list mailing list