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  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to