File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 4343 SYMBOL_FUNCBASE_TYPES ,
4444 ArgKind ,
4545 CallExpr ,
46- ClassDef ,
4746 Context ,
4847 Expression ,
4948 FuncDef ,
@@ -250,20 +249,10 @@ def report(
250249 """
251250
252251 def span_from_context (ctx : Context ) -> Iterable [int ]:
253- """This determines where a type: ignore for a given context has effect.
254-
255- Current logic is a bit tricky, to keep as much backwards compatibility as
256- possible. We may reconsider this to always be a single line (or otherwise
257- simplify it) when we drop Python 3.7.
258-
259- TODO: address this in follow up PR
260- """
261- if isinstance (ctx , (ClassDef , FuncDef )):
252+ """This determines where a type: ignore for a given context has effect."""
253+ if not isinstance (ctx , Expression ):
262254 return range (ctx .line , ctx .line + 1 )
263- elif not isinstance (ctx , Expression ):
264- return [ctx .line ]
265- else :
266- return range (ctx .line , (ctx .end_line or ctx .line ) + 1 )
255+ return range (ctx .line , (ctx .end_line or ctx .line ) + 1 )
267256
268257 origin_span : Iterable [int ] | None
269258 if origin is not None :
You can’t perform that action at this time.
0 commit comments