MCPcopy Index your code
hub / github.com/python/mypy / prefer_simple_messages

Method prefer_simple_messages

mypy/errors.py:989–1008  ·  view source on GitHub ↗

Should we generate simple/fast error messages? Return True if errors are not shown to user, i.e. errors are ignored or they are collected for internal use only. If True, we should prefer to generate a simple message quickly. All normal errors should still be reporte

(self)

Source from the content-addressed store, hash-verified

987 return file in self.error_info_map and file not in self.ignored_files
988
989 def prefer_simple_messages(self) -> bool:
990 """Should we generate simple/fast error messages?
991
992 Return True if errors are not shown to user, i.e. errors are ignored
993 or they are collected for internal use only.
994
995 If True, we should prefer to generate a simple message quickly.
996 All normal errors should still be reported.
997 """
998 if self.file in self.ignored_files:
999 # Errors ignored, so no point generating fancy messages
1000 return True
1001 if self.options.ignore_errors:
1002 return True
1003 if self._watchers:
1004 _watcher = self._watchers[-1]
1005 if _watcher._filter is True and _watcher._filtered is None:
1006 # Errors are filtered
1007 return True
1008 return False
1009
1010 def raise_error(self, use_stdout: bool = True) -> NoReturn:
1011 """Raise a CompileError with the generated messages.

Callers 7

check_subtypeMethod · 0.45
report_missing_attributeFunction · 0.45
check_callable_callMethod · 0.45
check_argMethod · 0.45
module_not_foundFunction · 0.45
name_not_definedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected