Package: python2.4
Version: 2.4.4-2
Severity: normal

Hello,

I wrote a function to compute quotient and reminder between time deltas
and I was testing it on edge cases, while I stumbled into this:

  >>> from datetime import *
  >>> timedelta(999999999, 86399, 999999) - timedelta(999999999, 86399, 999998)
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  OverflowError: days=-1000000000; must have magnitude <= 999999999
  >>>

The expected result is of course timedelta(0, 0, 1):

  >>> timedelta(999999999, 86399, 999998) + timedelta(0, 0, 1)
  datetime.timedelta(999999999, 86399, 999999)

Both time deltas are within the range documented in
/usr/share/doc/python-doc/html/lib/datetime-timedelta.html


Ciao,

Enrico


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19.1enrico
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)

Versions of packages python2.4 depends on:
ii  libbz2-1.0                   1.0.3-6     high-quality block-sorting file co
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libdb4.4                     4.4.20-8    Berkeley v4.4 Database Libraries [
ii  libncursesw5                 5.5-5       Shared libraries for terminal hand
ii  libreadline5                 5.2-2       GNU readline and history libraries
ii  libssl0.9.8                  0.9.8c-4    SSL shared libraries
ii  mime-support                 3.39-1      MIME files 'mime.types' & 'mailcap
ii  python2.4-minimal            2.4.4-2     A minimal subset of the Python lan

python2.4 recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to