That's interesting, thanks. It'd be awesome to have a named list as well.
Looks like python 3 has a general namespace type though that is usable.



On Tue, Feb 11, 2014 at 8:22 AM, adamrp <notifications@github.com> wrote:

> In bipy/maths/stats/ordination/base.py:
>
> > +
> > +
> > +class OrdinationResults(namedtuple('OrdinationResults',
> > +                                   ('eigvals', 'species', 'site', 'biplot',
> > +                                    'site_constraints'))):
> > +    __slots__ = ()  # To avoid creating a dict, as a namedtuple
> > +                    # doesn't have it
> > +
> > +    def __new__(cls, eigvals, species, site=None, biplot=None,
> > +                site_constraints=None):
> > +        return super(OrdinationResults, cls).__new__(cls, eigvals, species,
> > +                                                     site, biplot,
> > +                                                     site_constraints)
> > +
> > +
> > +class OrdinationResults2(namedtuple('OrdinationResults2',
>
> Pedantic curiosity led me to [this SO post](
> http://stackoverflow.com/questions/9872255/when-and-why-should-i-use-a-namedtuple-instead-of-a-dictionary)
> after I began to wonder what advantages a list of ```namedtuples``` had
> over ```dict.items()```, just thought I'd share since others might be
> wondering the same thing :)
> ... <#144218ab9935965b_>
> On Mon, Feb 10, 2014 at 9:38 PM, Daniel McDonald <notifications@github.com>wrote:
> In bipy/maths/stats/ordination/base.py: > + > + > +class
> OrdinationResults(namedtuple('OrdinationResults', > + ('eigvals',
> 'species', 'site', 'biplot', > + 'site_constraints'))): > + __slots__ = ()
> # To avoid creating a dict, as a namedtuple > + # doesn't have it > + > +
> def __new__(cls, eigvals, species, site=None, biplot=None, > +
> site_constraints=None): > + return super(OrdinationResults,
> cls).__new__(cls, eigvals, species, > + site, biplot, > + site_constraints)
> > + > + > +class OrdinationResults2(namedtuple('OrdinationResults2', Ya,
> that's awesome business. Definitely going to start using those -- Reply to
> this email directly or view it on GitHub<
> https://github.com/biocore/bipy/pull/90/files#r9613472> .
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/biocore/bipy/pull/90/files#r9627297>
> .
>