Chris Withers ch...@simplistix.co.uk added the comment:
I think so.
FWIW, I'd recommend looking at:
http://pypi.python.org/pypi/python-dateutil
...for doing things that python's builtin datetime stuff doesn't cater
for.
--
resolution: - wont fix
status: open - closed
Marc-Andre Lemburg m...@egenix.com added the comment:
Or use the original lib on which this is all based :-)
http://www.egenix.com/products/python/mxBase/mxDateTime/
(and which, of course, does allow subtracting times)
--
nosy: +lemburg
___
Python
Ezio Melotti ezio.melo...@gmail.com added the comment:
If there's no obviously best way to handle overflow, can this be closed?
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3250
Skip Montanaro [EMAIL PROTECTED] added the comment:
George To handle overflows, I figured it should wrap around a 24-hour
George limit.
That's precisely the reason that time objects don't support arithmetic.
There is no obviously best way to handle overflow.
--
nosy:
Chris Withers [EMAIL PROTECTED] added the comment:
Hi George,
I haven't looked at your patch but that fact that there are no unit
tests and you talk about copying and pasting code, I'd suggest this
might not be a good patch.
Refactor so code is only in one place rather than copying and
George Boutsioukis [EMAIL PROTECTED] added the comment:
Hi Chris,
I know copy-pasted sounds horrible--perhaps I should have said 'modeled
afterwards'(better marketing;). The thing is, the datetime time
classes share a lot of common functionality; it is inevitable that some
code looks like
George Boutsioukis [EMAIL PROTECTED] added the comment:
I have also come across this in the past. Although I sense that some
obscure reason might prevent time arithmetic from being included, here's
a patch to add time/timedelta addition and subtraction. It closely
follows the datetime arithmetic
New submission from Chris Withers [EMAIL PROTECTED]:
from datetime import time
time(9,0)-time(8,0)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: unsupported operand type(s) for -: 'datetime.time' and
'datetime.time'
I'd expect a datetime.timedelta(0,3600)
Changes by Benjamin Peterson [EMAIL PROTECTED]:
--
type: - feature request
versions: +Python 2.7 -Python 2.4, Python 2.5
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3250
___