should precision and sign of decimal(0) be significant?

"Vernon D. Cole" <[email protected]>
Newsgroups gmane.comp.python.db
Message-ID <CAH-ZgAcbs5Xcqax6RykaRVDNtkKkG2fL4kR_5_u9ycoYjWjPSw@mail.gmail.com>
I am working on code (django-mssql) where I found the following test:

##            expected = (
##                Decimal('0.00'),
##                Decimal('0.0'),
##                Decimal('-0.00'))
##
##            cur = con.cursor()

##            cur.paramstyle = 'format'  # a nonstandard extension -- VDC

##            cur.execute("SELECT %s as A, %s as B, %s as C", expected)
##
##            result = cur.fetchall()
##            self.assertEqual(result[0], expected)

I added the paramstyle alteration, to match the original test's assumption
-- that is not what I am asking about.  My question is: is this test
reasonable on it's face?

I personally think that all values of zero are equal, and the user should
have no expectation that neqative zero, or an accurately precise zero,
should be returned. My present code returns three copies of Decimal(0).

But someone must disagree, or this test would not have been written.

What is the feeling of the group?
--
Vernon Cole

_______________________________________________
DB-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/db-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.