I really enjoy using the Option and Either monads in Scala. Are there any equivalent for these things in Python? If there aren\'t, then what is the pythonic way of handling erro
In python, for an absence of value, the variable is None, so you can do it this way.
vars = None vars = myfunction() if vars is None: print 'No value!' else: print 'Value!'
or even just check if a value is present like this
if vars is not None: print vars