[Biopython-dev] Bio._utils iterlen not needed

Eric Talevich eric.talevich at gmail.com
Thu Jan 10 21:50:45 UTC 2013


On Thu, Jan 10, 2013 at 4:16 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Thu, Jan 10, 2013 at 5:24 PM, Michiel de Hoon <mjldehoon at yahoo.com>
> wrote:
> > That said, currently the iterlen function is used in only one place,
> > in Bio/Phylo/BaseTree.py as follows:
>
> True. I hadn't checked that - I assumed it was used more
> than once. If there are no other natural placed where it would
> make sense then yes, it might as well be done in line once,
> and Bio._utils.iterlen could be removed.
>
> When written, iterlen was in private module Bio.Phylo._sugar
> (CC'ing Eric) which Bow moved to Bio._utils as he wanted to
> use some of it in SearchIO.
>

That's all true. I created _sugar.py during GSoC 2009 for utility code that
Bio.Phylo needed, but wasn't related to trees in any way -- similar to
Bow's thinking. I probably meant to get rid of the module entirely after
the grand merge (hence the note at the top of _sugar.py to keep the file as
small as possible). IIRC, I made it a separate function while testing
whether "enumerate" or "cnt += 1" would be faster.

I have no objections to getting rid of the function now.

-E



More information about the Biopython-dev mailing list