Error: Cannot convert Decimal("0.0000") to Decimal

Discussion in 'Python' started by Vitaliy, May 29, 2008.

  1. Vitaliy

    Vitaliy Guest

    Hi

    I got this wired exception periodically (Python 2.5, Django based
    application)
    what does it mean ?
     
    Vitaliy, May 29, 2008
    #1
    1. Advertising

  2. Vitaliy

    Peter Otten Guest

    Vitaliy wrote:

    > I got this wired exception periodically (Python 2.5, Django based
    > application)
    > what does it mean ?


    A reload() maybe?

    >>> import decimal
    >>> d = decimal.Decimal()
    >>> reload(decimal)

    <module 'decimal' from '/usr/lib/python2.5/decimal.pyc'>
    >>> decimal.Decimal(d)

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.5/decimal.py", line 617, in __new__
    raise TypeError("Cannot convert %r to Decimal" % value)
    TypeError: Cannot convert Decimal("0") to Decimal

    Peter
     
    Peter Otten, May 29, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan C Douglas
    Replies:
    5
    Views:
    408
    Dan C Douglas
    Jul 22, 2003
  2. =?Utf-8?B?SlJPQ2FtYXJv?=
    Replies:
    6
    Views:
    4,189
  3. Replies:
    0
    Views:
    10,216
  4. =?Utf-8?B?V2VlIEt1YW4=?=
    Replies:
    0
    Views:
    3,038
    =?Utf-8?B?V2VlIEt1YW4=?=
    Nov 20, 2006
  5. Tomás

    Zero always == 0000 0000

    Tomás, Mar 5, 2006, in forum: C++
    Replies:
    15
    Views:
    560
    Tomás
    Mar 8, 2006
Loading...

Share This Page