Q: finding distance between 2 time's

John Machin sjmachin at lexicon.net
Sun May 31 09:06:49 EDT 2009


On May 31, 10:19 pm, mar... at hvidberg.net wrote:
> >http://en.wikipedia.org/wiki/Subtraction
>
> Only one problem, wise arse:
> TypeError: unsupported operand type(s) for -: 'time.struct_time' and
> 'time.struct_time'
>
> Like I didn't try that...

The point being that you can subtract them in other ways than by
shoving a - between them and throwing the result at Python. What you
were doing was like saying "I was born in January MCMLXXXIX and it's
now MMIX; how do I work out how old I am?" when you *already* had the
relevant numbers in a easily-subtractable form.



More information about the Python-list mailing list