Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_descrtut.defaultdict Class Reference

List of all members.

Public Member Functions

def __init__
def __getitem__
def get
def merge

Public Attributes

 default

Detailed Description

Definition at line 14 of file test_descrtut.py.


Constructor & Destructor Documentation

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

Definition at line 15 of file test_descrtut.py.

00015 
00016     def __init__(self, default=None):
00017         dict.__init__(self)
00018         self.default = default

Here is the caller graph for this function:


Member Function Documentation

def test.test_descrtut.defaultdict.__getitem__ (   self,
  key 
)

Definition at line 19 of file test_descrtut.py.

00019 
00020     def __getitem__(self, key):
00021         try:
00022             return dict.__getitem__(self, key)
00023         except KeyError:
00024             return self.default

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

Definition at line 25 of file test_descrtut.py.

00025 
00026     def get(self, key, *args):
00027         if not args:
00028             args = (self.default,)
00029         return dict.get(self, key, *args)

Here is the caller graph for this function:

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

Definition at line 30 of file test_descrtut.py.

00030 
00031     def merge(self, other):
00032         for key in other:
00033             if key not in self:
00034                 self[key] = other[key]


Member Data Documentation

Definition at line 17 of file test_descrtut.py.


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