Passed
Push — master ( df3bcb...d239e0 )
by Fabio
01:14
created

benedict.core.keylists.keylists()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
# -*- coding: utf-8 -*-
2
3
from benedict.utils import type_util
4
5
6
def _get_keylist(item, parent_keys):
7
    l = []
8
    for key, value in item.items():
9
        keys = parent_keys + [key]
10
        l += [keys]
11
        if type_util.is_dict(value):
12
            l += _get_keylist(value, keys)
13
    return l
14
15
16
def keylists(d):
17
    return _get_keylist(d, [])
18