MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / process_void_list

Method process_void_list

python/cudaq/kernel/ast_bridge.py:4075–4093  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4073 node)
4074
4075 def process_void_list():
4076 # NOTE: This does not actually create a valid value, and will fail
4077 # if something tries to use the value that this was supposed to
4078 # create later on. Keeping this to keep existing functionality, but
4079 # this is a bit questionable. Aside from no list being produced,
4080 # this should work regardless of what we iterate over or what
4081 # expression we evaluate.
4082 self.emitWarning(
4083 "produced elements in list comprehension contain None - "
4084 "expression will be evaluated but no list is generated", node)
4085 forNode = ast.For()
4086 forNode.iter = node.generators[0].iter
4087 forNode.target = node.generators[0].target
4088 forNode.body = [node.elt]
4089 forNode.orelse = []
4090 forNode.lineno = node.lineno
4091 # This loop could be marked as invariant if we didn't use
4092 # `visit_For`, but that would be premature optimization.
4093 self.visit_For(forNode)
4094
4095 def evalFilter():
4096 cond = None

Callers

nothing calls this directly

Calls 2

emitWarningMethod · 0.95
visit_ForMethod · 0.95

Tested by

no test coverage detected