( test ) >>> class Test: def __getitem__ ( self , value ) : return 1 ...: ( test ) >>> maybe ( Test ( ) ) [ 0 ] --------------------------------------------------------------------------- AttributeError Traceback ( most recent call last ) < ipython-input- 6 -e4a755e77e5b > in < module > ( ) ---- > 1 maybe ( Test ( ) ) [ 0 ] /home/sam/. local /share/virtualenvs/ test /local/lib/python2.7/site-packages/pymaybe/ __init__ . pyc in __getitem__ ( self , key ) 212 213 def __getitem__ ( self , key ) : -- > 214 return maybe ( self .__value. get ( key , None ) ) 215 216 def __setitem__ ( self , key , value ) : AttributeError : Test instance has no attribute 'get' ( test ) >>> Test ( ) [ 0 ] 1