code: def do_edit(self, arg):
          "Open an editor visiting the current file at the current line"
          if arg == '':
              filename, lineno = self._get_current_position()
          else:
              filename, lineno, _ = self._get_position_of_arg(arg)
              if filename is None:
                  return
          # this case handles code generated with py.code.Source()
          # filename is something like '<0-codegen foo.py:18>'
          match = re.match(r'.*<\d+-codegen (.*):(\d+)>', filename)
          if match:
              filename = match.group(1)
              lineno = int(match.group(2))
  
          try:
              self._open_editor(self._get_editor_cmd(filename, lineno))
          except Exception as exc:
              self.error(excf do_edit(self, arg):
          "Open an editor visiting the current file at the current line"
          if arg == '':
              filename, lineno = self._get_current_position()
          else:
              filename, lineno, _ = self._get_position_of_arg(arg)
              if filename is None:
                  return
          # this case handles code generated with py.code.Source()
          # filename is something like '<0-codegen foo.py:18>'
          match = re.match(r'.*<\d+-codegen (.*):(\d+)>', filename)
          if match:
              filename = match.group(1)
              lineno = int(match.group(2))
  
          try:
              self._open_editor(self._get_editor_cmd(filename, lineno))
          except Exception as exc:
              self.error(exc)
docs: Open an editor visiting the current file at the current line