parameters: (text)
return_statement: return first, last
docstring: Return tuple of 'line.col' indexes from selection or insert mark.
docstring_summary: Return tuple of 'line.col' indexes from selection or insert mark.
docstring_tokens: Return tuple of line . col indexes from selection or insert mark .
function: def get_selection(text):
      '''Return tuple of 'line.col' indexes from selection or insert mark.
      '''
      try:
          first = text.index("sel.first")
          last = text.index("sel.last")
      except TclError:
          first = last = None
      if not first:
          first = text.index("insert")
      if not last:
          last = first
      return first, last
function_tokens: def get_selection ( text ) : try : first = text . index ( "sel.first" ) last = text . index ( "sel.last" ) except TclError : first = last = None if not first : first = text . index ( "insert" ) if not last : last = first return first , last