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

Method span_from_context

mypy/messages.py:233–237  ·  view source on GitHub ↗

This determines where a type: ignore for a given context has effect.

(self, ctx: Context)

Source from the content-addressed store, hash-verified

231 return self.errors.prefer_simple_messages()
232
233 def span_from_context(self, ctx: Context) -> Iterable[int]:
234 """This determines where a type: ignore for a given context has effect."""
235 if not isinstance(ctx, Expression):
236 return [ctx.line]
237 return range(ctx.line, (ctx.end_line or ctx.line) + 1)
238
239 def report(
240 self,

Callers 1

reportMethod · 0.95

Calls 2

isinstanceFunction · 0.85
rangeClass · 0.85

Tested by

no test coverage detected