On Dec 14, 5:51 pm, Paul Moore <p.f.mo...@gmail.com> wrote: > On 14 Dec, 16:22, Bruno Desthuilliers > > <bdesth.quelquech...@free.quelquepart.fr> wrote: > > if you only want the first returned value, you can just apply a slice: > > > def f(): > > return 1,2,3 > > > a = f()[0] + 1 > > Hmm, true. I'm not sure it's any less ugly, though :-) > > > FWIW, Python 2.6 has NamedTuple objects... > > I know, but I want to target 2.5+ (I still have a number of systems > running 2.5) >
There is a Python implementation of NamedTuple on the Python cookbook that is compatible with Python 2.5. Michael Foord http://www.ironpythoninaction.com/ -- http://mail.python.org/mailman/listinfo/python-list