It is very easy for nested list comprehensions to become unreadable.
Allowing them at all will make it easier for nasty ones slip through.
Disallowing them is an explicit point that I will like to see included in
the to-be-refreshed guidelines. It is much more important to err on the
side of readability; code maintenance is hard enough as is.


On Wed, Dec 4, 2013 at 10:57 AM, Yoshiki Vázquez Baeza <
notifications@github.com> wrote:

> In qiime/otu_significance.py:
>
> > +    taxonomy_md = biom_taxonomy_formatter(bt, md_key)
> > +    if taxonomy_md is not None:
> > +        for i in range(num_lines):
> > +            lines[i+1]=lines[i+1]+'\t'+taxonomy_md[i] #skip header line in lines
> > +    return lines
> > +
> > +# Functions for gradient correlation testing
> > +
> > +def grouped_correlation_row_generator(bt, pmf, category, gc_to_samples):
> > +    '''Create generator for grouped correlation tests.
> > +
> > +    '''
> > +    data = array([bt.observationData(i) for i in bt.ObservationIds])
> > +    category_values = gc_to_samples.keys()
> > +    samples = gc_to_samples.values()
> > +    sample_inds = [[bt.getSampleIndex(i) for i in group] for group in samples]
>
> This is one of those things where IMHO you either allow them all or not.
> You cannot only allow "the ones that are clear" because then this becomes
> very ambiguous very quickly.
>
> Given that we don't have coding guidelines and that disallow this as it
> is, it seems hard to just say no to this particular line.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/qiime/qiime/pull/1091/files#r8103445>
> .
>