Version: 9.12.0
diclookup.Lookup Class Reference

a dictionary which can lookup value by key, or keys by value More...

Inheritance diagram for diclookup.Lookup:

Public Member Functions

def __init__ (self, items=None)
 items can be a list of pair_lists or a dictionary More...
 
def get_keys (self, value)
 find the key(s) as a list given a value More...
 
def get_key (self, value)
 find the key associated to the given a value. More...
 
def get_value (self, key)
 find the value given a key More...
 

Detailed Description

a dictionary which can lookup value by key, or keys by value

Constructor & Destructor Documentation

◆ __init__()

def diclookup.Lookup.__init__ (   self,
  items = None 
)

items can be a list of pair_lists or a dictionary

Member Function Documentation

◆ get_key()

def diclookup.Lookup.get_key (   self,
  value 
)

find the key associated to the given a value.

If several keys exist, only the first is given. To get the whole list, use get_keys instead.

References diclookup.Lookup.get_keys(), and KERNEL_PY.kernel.diclookup.Lookup.get_keys().

◆ get_keys()

def diclookup.Lookup.get_keys (   self,
  value 
)

◆ get_value()

def diclookup.Lookup.get_value (   self,
  key 
)

find the value given a key