tableentrysort.py 文件源码

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

项目:pipenv 作者: pypa 项目源码 文件源码
def _sorted_table(table):
    """
    Returns another TableElement where the table entries are sorted lexicographically by key.
    """
    assert isinstance(table, TableElement)

    # Discarding TokenElements with no tokens in them
    table_elements = common.non_empty_elements(table.sub_elements)
    lines = tuple(common.lines(table_elements))
    sorted_lines = sorted(lines, key=_line_key)
    sorted_elements = reduce(operator.concat, sorted_lines)

    return TableElement(sorted_elements)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号