diff options
| author | Nick Coghlan <ncoghlan@gmail.com> | 2006-05-03 13:02:47 (GMT) | 
|---|---|---|
| committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-05-03 13:02:47 (GMT) | 
| commit | afd5e63e243b600e5344a34760d9e6565dafe1a9 (patch) | |
| tree | 6fdd6c7dd056fd5d4ce1e67e7d0b430b374dd270 /Lib/decimal.py | |
| parent | 1b06a1d4e30729434630e9fa37b041926a5766f3 (diff) | |
| download | cpython-afd5e63e243b600e5344a34760d9e6565dafe1a9.zip cpython-afd5e63e243b600e5344a34760d9e6565dafe1a9.tar.gz cpython-afd5e63e243b600e5344a34760d9e6565dafe1a9.tar.bz2  | |
Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
Diffstat (limited to 'Lib/decimal.py')
| -rw-r--r-- | Lib/decimal.py | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 2f989a8..2e0afff 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -2173,7 +2173,7 @@ for name in rounding_functions:  del name, val, globalname, rounding_functions -class WithStatementContext(object): +class ContextManager(object):      """Helper class to simplify Context management.      Sample usage: @@ -2248,8 +2248,8 @@ class Context(object):          s.append('traps=[' + ', '.join([t.__name__ for t, v in self.traps.items() if v]) + ']')          return ', '.join(s) + ')' -    def context_manager(self): -        return WithStatementContext(self.copy()) +    def get_manager(self): +        return ContextManager(self.copy())      def clear_flags(self):          """Reset all flags to zero"""  | 
