Simple questions on use of objects (probably faq)

Brian Elmegaard brian at rkspeed-rugby.dk
Fri Mar 10 08:55:13 CET 2006


Michael <ms at cerenity.org> writes:

> Based on the code that runs, you want* this:
>
> [(y[x+1].x-y[x].x) for x in range(len(y)-1) ]

Yes.

> Since personally I find that a lot clearer than:
>
> map(float.__sub__, [X.x for X in y[1:]], [X.x for X in y[:-1] ])

Me too.

-- 
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk



More information about the Python-list mailing list