def takewhile_inclusive(pred, seq):
 for e in seq:
  (yield e)
  if (not pred(e)):
   return

def takewhile_inclusive ( pred , seq ) : for e in seq : ( yield e ) if ( not pred ( e ) ) : return
like itertools .