""" Illustration of logic short circuiting >>> import shortcircuit >>> shortcircuit.both() no yes True >>> shortcircuit.first() yes True >>> """ def yes(): print " yes" return True def no(): print " no" return False def both(): print no() or yes() def first(): print yes() or no()