[Python-Dev] iterzip()

Guido van Rossum guido@python.org
Mon, 29 Apr 2002 08:18:52 -0400

> Will do.  I think the resistance to moving the functionals will be
> fierce.

You might try to deprecate reduce() though.  It's useless.

> Divmod probably has very few instances in real code.

Not so sure.  It's very handy in converting numbers to weird-radix or
mixed-radix systems.  E.g. it's a natural for converting posix
timestamps to broken-out times, and e.g.
<CVSROOT>/nondist/sandbox/datetime/datetime.py is full of it.

> I think __pow__ would need to be left in (as the ** that calls it),
> but the function itself may be used only rarely.

Unfortunately the function is needed as the API to 3-arg pow() --
which doesn't easily fit in the math library since it's not a floating
point thing.

> Does anyone know of an automated what that I can scan a large body
> of published Python code.  I would want some real usage statistics
> in a PEP but hate pulling modules down one at a time and grepping
> them.

You can write something using urllib that pulls things down, and I
recommend using the tokenizer module to do the parsing -- much slower
than grep, but doesn't get confused by comments etc.  See
Tools/scripts/finddiv.py for an example.

--Guido van Rossum (home page: http://www.python.org/~guido/)