Defining “boolness” of a class in python

前端 未结 3 2215
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 17:06

Why doesn\'t this work as one may have naively expected?

class Foo(object):
    def __init__(self):
        self.bar = 3
    def __bool__(self):
        retu         


        
3条回答
提交回复
热议问题