[EMAIL PROTECTED] (Alex Martelli) writes:
> Stefan Arentz <[EMAIL PROTECTED]> wrote:
>
> > Miki <[EMAIL PROTECTED]> writes:
> >
> > > > steps.sort(key = lambda s: s.time)
> > > This is why attrgetter in the operator module was invented.
> > > from operator import attrgetter
> > > ...
> > > ste
Stefan Arentz <[EMAIL PROTECTED]> wrote:
> Miki <[EMAIL PROTECTED]> writes:
>
> > > steps.sort(key = lambda s: s.time)
> > This is why attrgetter in the operator module was invented.
> > from operator import attrgetter
> > ...
> > steps.sort(key=attrgettr("time"))
>
> Personally I prefer the a
Miki <[EMAIL PROTECTED]> writes:
> > steps.sort(key = lambda s: s.time)
> This is why attrgetter in the operator module was invented.
> from operator import attrgetter
> ...
> steps.sort(key=attrgettr("time"))
Personally I prefer the anonymous function over attrgettr :)
S.
--
http://mail.pyt
> steps.sort(key = lambda s: s.time)
This is why attrgetter in the operator module was invented.
from operator import attrgetter
...
steps.sort(key=attrgettr("time"))
HTH,
--
Miki <[EMAIL PROTECTED]>
http://pythonwise.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 07 Sep 2007 06:57:35 -0700, cjt22 wrote:
> I have a step class and store in a list step instances
> A step instance contains variables: name, startTime etc and startTime
> is stored as a string %H:%M:%S
>
> What I would like to do is to be able to sort this list of objects
> based on the
[EMAIL PROTECTED] writes:
> Hi there
>
> I am fairly new to Python and have not really used regular expressions
> before (I think this might be needed for my query) and wondered if you
> could help
>
> I have a step class and store in a list step instances
> A step instance contains variables: n
[EMAIL PROTECTED] wrote:
> Hi there
>
> I am fairly new to Python and have not really used regular expressions
> before (I think this might be needed for my query) and wondered if you
> could help
>
> I have a step class and store in a list step instances
> A step instance contains variables: nam
Hi there
I am fairly new to Python and have not really used regular expressions
before (I think this might be needed for my query) and wondered if you
could help
I have a step class and store in a list step instances
A step instance contains variables: name, startTime etc and startTime
is stored