I see what you did there haha. It's not dangerous as is but as far as I remember python will only close the file handles once the program ends hence proliferating the life of a file descriptor for longer than it's needed. 

On Mar 24, 2014, at 9:23 PM, samfway <notifications@github.com> wrote:

> In scripts/make_plots.py:
> 
> > +def get_sample_ids_to_label(samples_file):
> > +    """ Get sample id, label tuples to be highlighted """ 
> > +    sample_label_tuples = [] 
> > +    for line in open(samples_file, 'rU'):
> > +        if line[0] == '#': 
> > +            continue 
> > +        line_pieces = [x.strip() for x in line.split('\t')]
> > +        if len(line_pieces) == 2:
> > +            sample_label_tuples.append(tuple(line_pieces[0:2]))
> > +
> > +    return sample_label_tuples
> > +
> > +def get_key_taxa(key_taxa_file):
> > +    """ Load taxa to be plotted from file """ 
> > +    key_taxa = []
> > +    for line in open(key_taxa_file, 'rU'):
> consider it.closed(). Question: is having the open statement in the for loop dangerous?
> 
> —
> Reply to this email directly or view it on GitHub.
>