def format_stack(f=None, limit=None):
 if (f is None):
  try:
   raise ZeroDivisionError
  except ZeroDivisionError:
   f = sys.exc_info()[2].tb_frame.f_back
 return format_list(extract_stack(f, limit))

def format_stack ( f = None , limit = None ) : if ( f is None ) : try : raise ZeroDivisionError except ZeroDivisionError : f = sys . exc_info ( ) [ 2 ] . tb_frame . f_back return format_list ( extract_stack ( f , limit ) )
shorthand for format_list(extract_stack) .