# libtmux._internal.query_list.parse_lookup

- **Module:** libtmux._internal.query_list
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/_internal/query_list.py#L115
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-_internal-query_list-parse_lookup/

```
libtmux._internal.query_list.parse_lookup(
    obj: Mapping[str, t.Any], path: str, lookup: str
) -> t.Any | None
```

Check if field lookup key, e.g. "my__path__contains" has comparator, return val.

If comparator not used or value not found, return None.

```python
>>> parse_lookup({ "food": "red apple" }, "food__istartswith", "__istartswith")
'red apple'
```

It can also look up objects:

```python
>>> from dataclasses import dataclass
```

```python
>>> @dataclass()
... class Inventory:
...     food: str
```

```python
>>> item = Inventory(food="red apple")
```

```python
>>> item
Inventory(food='red apple')
```

```python
>>> parse_lookup(item, "food__istartswith", "__istartswith")
'red apple'
```

## Parameters

- `obj` (`Mapping[str, t.Any]`)
- `path` (`str`)
- `lookup` (`str`)
