Package dns :: Module namedict :: Class NameDict
[hide private]
[frames] | no frames]

Class NameDict

source code

       object --+            
                |            
    _abcoll.Sized --+        
                    |        
       object --+   |        
                |   |        
 _abcoll.Iterable --+        
                    |        
       object --+   |        
                |   |        
_abcoll.Container --+        
                    |        
      _abcoll.Mapping --+    
                        |    
   _abcoll.MutableMapping --+
                            |
                           NameDict

A dictionary whose keys are dns.name.Name objects.

In addition to being like a regular Python dictionary, this dictionary can also get the deepest match for a given key.

Nested Classes [hide private]

Inherited from _abcoll.Sized: __metaclass__

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__update_max_depth(self, key) source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__delitem__(self, key) source code
 
__iter__(self) source code
 
__len__(self) source code
 
has_key(self, key) source code
 
get_deepest_match(self, name)
Find the deepest match to *fname* in the dictionary.
source code

Inherited from _abcoll.MutableMapping: clear, pop, popitem, setdefault, update

Inherited from _abcoll.Mapping: __contains__, __eq__, __ne__, get, items, iteritems, iterkeys, itervalues, keys, values

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Class Methods [hide private]

Inherited from _abcoll.Sized: __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset([])
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x10b0201d0>
  _abc_negative_cache_version = 26
  _abc_registry = <_weakrefset.WeakSet object at 0x10b020050>

Inherited from _abcoll.Mapping: __hash__

Inherited from _abcoll.Sized (private): _abc_cache

Properties [hide private]
  __store
  max_depth
  max_depth_items

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__getitem__(self, key)
(Indexing operator)

source code 
Overrides: _abcoll.Mapping.__getitem__

__setitem__(self, key, value)
(Index assignment operator)

source code 
Overrides: _abcoll.MutableMapping.__setitem__

__delitem__(self, key)
(Index deletion operator)

source code 
Overrides: _abcoll.MutableMapping.__delitem__

__iter__(self)

source code 
Overrides: _abcoll.Iterable.__iter__

__len__(self)
(Length operator)

source code 
Overrides: _abcoll.Sized.__len__

get_deepest_match(self, name)

source code 

Find the deepest match to *fname* in the dictionary.

The deepest match is the longest name in the dictionary which is a superdomain of *name*. Note that *superdomain* includes matching *name* itself.

*name*, a ``dns.name.Name``, the name to find.

Returns a ``(key, value)`` where *key* is the deepest ``dns.name.Name``, and *value* is the value associated with *key*.