byoc.lookup

byoc.lookup(obj, key)

Lookup the given key in the given object.

Parameters
  • obj – Any object.

  • key

    If callable: The callable will be called with the given object as its only argument. Whatever it returns will be taken as the value of the key.

    If non-string iterable: The iterable will be considered as a sequence of keys to iteratively lookup in the object. In other words, the return value will be something like obj[key[0]][key[1]]....

    If anything else: The key will be looked up in the given object like so: obj[key].