Your message dated Tue, 03 Feb 2009 18:06:47 +0100
with message-id <[email protected]>
and subject line incompatibility of Decimal and float is upstream design 
decision
has caused the Debian Bug report #514003,
regarding python2.5: Type Decimal, int and float. Unsupported operand
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
514003: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514003
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python2.5
Version: 2.5.2-15
Severity: grave
Justification: causes non-serious data loss

When I mix different type of variable, I obtain some strange results:

a = Decimal.decimal(1)
b = 2
c = 2.

>>> a * b
Decimal("2")

>>> a < b
True

>>> a * c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'Decimal' and 'float'
>>> a < c
False

The same result with Debian Etch.

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=fr_CH, LC_CTYPE=fr_CH (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages python2.5 depends on:
ii  libbz2-1.0                1.0.5-1        high-quality block-sorting file co
ii  libc6                     2.7-18         GNU C Library: Shared libraries
ii  libdb4.5                  4.5.20-13      Berkeley v4.5 Database Libraries [
ii  libncursesw5              5.7+20081213-1 shared libraries for terminal hand
ii  libreadline5              5.2-3          GNU readline and history libraries
ii  libsqlite3-0              3.5.9-5        SQLite 3 shared library
ii  libssl0.9.8               0.9.8g-15      SSL shared libraries
ii  mime-support              3.44-1         MIME files 'mime.types' & 'mailcap
ii  python2.5-minimal         2.5.2-15       A minimal subset of the Python lan

python2.5 recommends no packages.

Versions of packages python2.5 suggests:
pn  python-profiler               <none>     (no description available)
ii  python2.5-doc                 2.5.2-2    Documentation for the high-level o

-- no debconf information



--- End Message ---
--- Begin Message ---
Hi Blaise,

the behaviour you observe is not a bug but a deliberate design choice:
In essence the Python developers felt that coersion between float and
Decimal cannot not be done in a way that does not introduce too much
surprising behaviour. Some detail can be found in the Decimal proposal[1].

As such, I am closing this bug report. Note that if you want to discuss
the merits of the design decision, the python.org lists are a much
better place.

Kind regards

T.

1. http://www.python.org/dev/peps/pep-0327/#id17
-- 
Thomas Viehmann, http://thomas.viehmann.net/


--- End Message ---

Reply via email to