parameters: (self, value: int)
docstring: Setting cursor position.
docstring_summary: Setting cursor position.
docstring_tokens: Setting cursor position .
function: def cursor_position(self, value: int) -> None:
          """
          Setting cursor position.
          """
          assert isinstance(value, int)
  
          # Ensure cursor position is within the size of the text.
          if value > len(self.text):
              value = len(self.text)
          if value < 0:
              value = 0
  
          changed = self._set_cursor_position(value)
  
          if changed:
              self._cursor_position_changed()
function_tokens: def cursor_position ( self , value : int ) -> None : assert isinstance ( value , int ) # Ensure cursor position is within the size of the text. if value > len ( self . text ) : value = len ( self . text ) if value < 0 : value = 0 changed = self . _set_cursor_position ( value ) if changed : self . _cursor_position_changed ( )