[Python-checkins] r50697 - python/trunk/Lib/decimal.py

Raymond Hettinger rhettinger at ewtllc.com
Tue Jul 18 17:36:27 CEST 2006


facundo.batista wrote:

>Python/trunk/Lib/decimal.py
>Log:
>Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón
>  
>
This patch is somewhat difficult to review.  It would be nice if the 
minor formatting adjustments were submitted separately from changes in 
functionality.  There was no need or value in most of the changes 
(adding two spaces after a period instead of one; adding one space after 
the start of a comment;  re-line-wrapping block comments; etc.) -- 
please don't do this to any other modules.  This goes double for 
reformatting code (changing "raise ValueError, str" to "raise 
ValueError(str)".  IMO, it is somewhat foolish to make these kind of 
changes after a beta-release.  It's up to Anthony, but we should 
probably revert this patch.

-    class MockThreading:
+    class MockThreading(obj


Why did MockThreading become a new-style class?


-                self._sign, self._int, self._exp = context._raise_error(ConversionSyntax)
+                self._sign, self._int, self._exp = \
+                                     context._raise_error(ConversionSyntax)


wtf?

-            if len(side.__add__(Decimal(1), context=context)._int) >= context.prec:
+            numbsquant = len(side.__add__(Decimal(1), context=context)._int)
+            if  numbsquant >= context.prec

Introducing a intermediate variable with an inscrutable variable name is not an improvement.


-                    return context._raise_error(Overflow, 'above Emax', ans._sign)
+                    c = context._raise_error(Overflow, 'above Emax', ans._sign)
+                    return c

Of what possible benefit is this?



Raymond




More information about the Python-checkins mailing list