test_traitlets_enum.py 文件源码

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

项目:yatta_reader 作者: sound88 项目源码 文件源码
def test_assign_none_without_allow_none_resets_to_default_value(self):
        class Example2(HasTraits):
            color1 = UseEnum(Color, allow_none=False)
            color2 = UseEnum(Color)

        example = Example2()
        example.color1 = None
        example.color2 = None
        self.assertIs(example.color1, Color.red)
        self.assertIs(example.color2, Color.red)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号