gclient.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Chromium_DepotTools 作者: p07r0457 项目源码 文件源码
def ast_dict_index(dnode, key):
  """Search an ast.Dict for the argument key, and return its index."""
  idx = [i for i in range(len(dnode.keys)) if (
      type(dnode.keys[i]) is ast.Str and dnode.keys[i].s == key)]
  if not idx:
    return -1
  elif len(idx) > 1:
    raise gclient_utils.Error('Multiple dict entries with same key in AST')
  return idx[-1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号