[Python-checkins] python/dist/src/Lib decimal.py,1.13,1.14

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Jul 9 12:52:58 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2966

Modified Files:
	decimal.py 
Log Message:
* Update the test suite to reflect that ConversionSyntax was no longer
  public.
* Removed the non-signal conditions from __all__.
* Removed the XXX comment which was resolved.
* Use ^ instead of operator.xor
* Remove the threading lock which is no longer necessary.



Index: decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/decimal.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** decimal.py	9 Jul 2004 10:02:51 -0000	1.13
--- decimal.py	9 Jul 2004 10:52:54 -0000	1.14
***************
*** 115,122 ****
  
      # Exceptions
!     'DecimalException', 'Clamped', 'InvalidOperation', 'ConversionSyntax',
!     'DivisionByZero', 'DivisionImpossible', 'DivisionUndefined',
!     'Inexact', 'InvalidContext', 'Rounded', 'Subnormal', 'Overflow',
!     'Underflow',
  
      # Constants for use in setting up contexts
--- 115,120 ----
  
      # Exceptions
!     'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero',
!     'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow',
  
      # Constants for use in setting up contexts
***************
*** 212,221 ****
          return NaN
  
- # XXX Is there a logic error in subclassing InvalidOperation?
- # Setting the InvalidOperation trap to zero does not preclude ConversionSyntax.
- # Also, incrementing Conversion syntax flag will not increment InvalidOperation.
- # Both of these issues interfere with cross-language portability because
- # code following the spec would not know about the Python subclasses.
- 
  class ConversionSyntax(InvalidOperation):
      """Trying to convert badly formed string.
--- 210,213 ----
***************
*** 1033,1037 ****
              return ans
  
!         resultsign = operator.xor(self._sign, other._sign)
          if self._isinfinity():
              if not other:
--- 1025,1029 ----
              return ans
  
!         resultsign = self._sign ^ other._sign
          if self._isinfinity():
              if not other:
***************
*** 1127,1131 ****
                  return ans
  
!         sign = operator.xor(self._sign, other._sign)
          if not self and not other:
              if divmod:
--- 1119,1123 ----
                  return ans
  
!         sign = self._sign ^ other._sign
          if not self and not other:
              if divmod:
***************
*** 2118,2123 ****
      """
  
-     DefaultLock = threading.Lock()
- 
      def __init__(self, prec=None, rounding=None,
                   trap_enablers=None, flags=None,
--- 2110,2113 ----
***************
*** 2128,2132 ****
          if flags is None:
              flags = dict.fromkeys(Signals, 0)
-         self.DefaultLock.acquire()
          for name, val in locals().items():
              if val is None:
--- 2118,2121 ----
***************
*** 2134,2138 ****
              else:
                  setattr(self, name, val)
-         self.DefaultLock.release()
          del self.self
  
--- 2123,2126 ----



More information about the Python-checkins mailing list