Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
decimal._ContextManager Class Reference

Context class #######################################################. More...

Inheritance diagram for decimal._ContextManager:
Inheritance graph
[legend]
Collaboration diagram for decimal._ContextManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __enter__
def __exit__

Public Attributes

 new_context
 saved_context
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Context class #######################################################.

Context manager class to support localcontext().

  Sets a copy of the supplied context in __enter__() and restores
  the previous decimal context in __exit__()

Definition at line 3779 of file decimal.py.


Constructor & Destructor Documentation

def decimal._ContextManager.__init__ (   self,
  new_context 
)

Definition at line 3785 of file decimal.py.

03785 
03786     def __init__(self, new_context):
        self.new_context = new_context.copy()

Here is the caller graph for this function:


Member Function Documentation

Definition at line 3787 of file decimal.py.

03787 
03788     def __enter__(self):
03789         self.saved_context = getcontext()
03790         setcontext(self.new_context)
        return self.new_context
def decimal._ContextManager.__exit__ (   self,
  t,
  v,
  tb 
)

Definition at line 3791 of file decimal.py.

03791 
03792     def __exit__(self, t, v, tb):
03793         setcontext(self.saved_context)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 3786 of file decimal.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 3788 of file decimal.py.


The documentation for this class was generated from the following file: