<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def type_check_cmd(self, args, range=None):
 """Sets the flag to begin buffering typecheck notes & clears any stale notes before requesting a typecheck from the server"""

        self.log.debug('type_check_cmd: in')
        self.start_typechecking()
        self.type_check("")
        self.editor.message('typechecking')