跳至内容

schola.core.utils.nested_get

函数定义

schola.core.utils.nested_get(dct, keys, default)

从嵌套字典中获取值,如果找不到键则返回默认值。

参数

dct

类型: NestedDict[K, V]
要搜索的字典。

keys

类型: Iterable[K]
要在字典中搜索的键。

default

类型: V
如果找不到键,则返回的值。

返回值

类型: V
在字典中找到的值,或在找不到键时返回的默认值。

返回类型: V

© . This site is unofficial and not affiliated with AMD.