ekampf / pymaybe

A Python implementation of the Maybe pattern
BSD 3-Clause "New" or "Revised" License
208 stars 6 forks source link

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

Open taoari opened 9 months ago

taoari commented 9 months ago

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)