test.py 文件源码

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

项目:enumap 作者: TadLeonard 项目源码 文件源码
def test_repr_sparse_typed():
    """Make sure that SparseEnumapMeta's __repr___ method works
    with typed fields
    """
    class Tools(SparseEnumap):
        head = default("your head")
        horse: float = default(3.14)
        donkey: int = auto()
        spatula = 100  # this isn't a default

    # None defaults are not explicitly shown for readability
    assert repr(Tools) == """Tools(
    head = 'your head',
    horse: float = 3.14,
    donkey: int,
    spatula
)"""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号