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

Method visit_dictionary_comprehension

mypy/semanal.py:6369–6382  ·  view source on GitHub ↗
(self, expr: DictionaryComprehension)

Source from the content-addressed store, hash-verified

6367 expr.generator.accept(self)
6368
6369 def visit_dictionary_comprehension(self, expr: DictionaryComprehension) -> None:
6370 if any(expr.is_async):
6371 if (
6372 not self.is_func_scope()
6373 or not self.function_stack
6374 or not self.function_stack[-1].is_coroutine
6375 ):
6376 self.fail(message_registry.ASYNC_FOR_OUTSIDE_COROUTINE, expr, code=codes.SYNTAX)
6377
6378 with self.enter(expr):
6379 self.analyze_comp_for(expr)
6380 expr.key.accept(self)
6381 expr.value.accept(self)
6382 self.analyze_comp_for_2(expr)
6383
6384 def visit_generator_expr(self, expr: GeneratorExpr) -> None:
6385 with self.enter(expr):

Callers

nothing calls this directly

Calls 7

is_func_scopeMethod · 0.95
failMethod · 0.95
enterMethod · 0.95
analyze_comp_forMethod · 0.95
analyze_comp_for_2Method · 0.95
anyFunction · 0.85
acceptMethod · 0.45

Tested by

no test coverage detected