pymaybe icon indicating copy to clipboard operation
pymaybe copied to clipboard

TypeError: object of type 'bool' has no len()

Open taoari opened this issue 1 year ago • 0 comments

Thanks for the library! However, I encountered a bug. For example, the following code, I got TypeError: object of type 'bool' has no len(). It works with obj.isVisible(), but fails for obj.isVisible() and True. Any idea?


from pymaybe import maybe

class My(object):

    def isVisible(self):
        return True

obj = maybe(My())
print(obj.isVisible() and True)

taoari avatar Sep 22 '23 17:09 taoari