Simple questions on use of objects (probably faq)

Brian Elmegaard brian at
Fri Mar 10 08:55:13 CET 2006

Michael <ms at> writes:

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


> 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)

More information about the Python-list mailing list