Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
test.test_descrtut.defaultdict2 Class Reference

List of all members.

Public Member Functions

def __init__
def __getitem__
def get
def merge

Public Attributes

 default

Static Private Attributes

list __slots__ = ['default']

Detailed Description

Definition at line 102 of file test_descrtut.py.


Constructor & Destructor Documentation

def test.test_descrtut.defaultdict2.__init__ (   self,
  default = None 
)

Definition at line 105 of file test_descrtut.py.

00105 
00106     def __init__(self, default=None):
00107         dict.__init__(self)
00108         self.default = default

Here is the caller graph for this function:


Member Function Documentation

Definition at line 109 of file test_descrtut.py.

00109 
00110     def __getitem__(self, key):
00111         try:
00112             return dict.__getitem__(self, key)
00113         except KeyError:
00114             return self.default

def test.test_descrtut.defaultdict2.get (   self,
  key,
  args 
)

Definition at line 115 of file test_descrtut.py.

00115 
00116     def get(self, key, *args):
00117         if not args:
00118             args = (self.default,)
00119         return dict.get(self, key, *args)

Here is the caller graph for this function:

def test.test_descrtut.defaultdict2.merge (   self,
  other 
)

Definition at line 120 of file test_descrtut.py.

00120 
00121     def merge(self, other):
00122         for key in other:
00123             if key not in self:
00124                 self[key] = other[key]


Member Data Documentation

list test.test_descrtut.defaultdict2.__slots__ = ['default'] [static, private]

Definition at line 103 of file test_descrtut.py.

Definition at line 107 of file test_descrtut.py.


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