[Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.36,
1.37 test_Decimal.py, 1.26, 1.27
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Thu Jul 1 06:01:59 EDT 2004
Update of /cvsroot/python/python/nondist/sandbox/decimal
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18515
Modified Files:
Decimal.py test_Decimal.py
Log Message:
* Add an __all__ attribute to Decimal.py
* Add a missing "import threading" to test_Decimal.py
* Mark some non-API globals as private
Index: Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Decimal.py 1 Jul 2004 08:21:28 -0000 1.36
--- Decimal.py 1 Jul 2004 10:01:42 -0000 1.37
***************
*** 11,20 ****
# Todo:
# Add deepcopy and pickle support for contexts
- # Rename to decimal.Decimal before moving into production
# Consider having a SimpleDecimal subclass implementing X3.274 semantics
- # Add an __all__ attribute
# Improve the Context API
# Provide a clean way of attaching monetary format representations
# Review all exposed constants for utility vs. namespace clutter
"""
--- 11,24 ----
# Todo:
# Add deepcopy and pickle support for contexts
# Consider having a SimpleDecimal subclass implementing X3.274 semantics
# Improve the Context API
+ # Especially with respect to setting flags and traps
+ # Consider adding a clear_flags() method to Context
# Provide a clean way of attaching monetary format representations
# Review all exposed constants for utility vs. namespace clutter
+ # When moving into core
+ # rename Decimal.py and test_Decimal.py to lowercase decimal
+ # retarget the test directory to decimaltestdata
+
"""
***************
*** 120,124 ****
"""
! # XXX Add an __all__ attribute
import threading
--- 124,155 ----
"""
! __all__ = [
! # Two major classes
! 'Decimal', 'Context',
!
! # Contexts
! 'DefaultContext', 'BasicDefaultContext', 'ExtendedDefaultContext',
!
! # Exceptions
! 'DecimalException', 'Clamped', 'InvalidOperation', 'ConversionSyntax',
! 'DivisionByZero', 'DivisionImpossible', 'DivisionUndefined',
! 'Inexact', 'InvalidContext', 'Rounded', 'Subnormal', 'Overflow',
! 'Underflow',
!
! # Module parameters
! 'SINGLE_PRECISION', 'DEFAULT_MAX_EXPONENT', 'DEFAULT_MIN_EXPONENT',
!
! # Constants for use in setting up contexts
! 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING',
! 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN',
! 'NEVER_ROUND', 'ALWAYS_ROUND',
! 'ExceptionList', # <-- Used for building trap/flag dictionaries
!
! # Functions for manipulating contexts
! 'setcontext', 'getcontext',
!
! # Functions for working with decimals
! 'isinfinity', 'isnan',
! ]
import threading
***************
*** 376,380 ****
! def filterfunct(obj):
"""Returns true if a subclass of DecimalException"""
try:
--- 407,411 ----
! def _filterfunct(obj):
"""Returns true if a subclass of DecimalException"""
try:
***************
*** 384,388 ****
#ExceptionList holds the exceptions
! ExceptionList = filter(filterfunct, globals().values())
#To fix reloading, force it to create a new context
--- 415,419 ----
#ExceptionList holds the exceptions
! ExceptionList = filter(_filterfunct, globals().values())
#To fix reloading, force it to create a new context
***************
*** 2979,2983 ****
! ##### Useful Constants ######################################
#Reusable defaults
--- 3010,3014 ----
! ##### Useful Constants (internal use only######################
#Reusable defaults
Index: test_Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** test_Decimal.py 1 Jul 2004 09:27:30 -0000 1.26
--- test_Decimal.py 1 Jul 2004 10:01:42 -0000 1.27
***************
*** 33,37 ****
from Decimal import *
from test.test_support import TestSkipped, run_unittest, run_doctest, is_resource_enabled
!
TESTDATADIR = 'tests'
--- 33,37 ----
from Decimal import *
from test.test_support import TestSkipped, run_unittest, run_doctest, is_resource_enabled
! import threading
TESTDATADIR = 'tests'
More information about the Python-checkins
mailing list