MCPcopy Index your code
hub / github.com/ipython/ipython / ast_parse

Method ast_parse

IPython/core/compilerop.py:81–86  ·  view source on GitHub ↗

Parse code to an AST with the current compiler flags active. Arguments are exactly the same as ast.parse (in the standard library), and are passed to the built-in compile function.

(self, source, filename='<unknown>', symbol='exec')

Source from the content-addressed store, hash-verified

79 self._filename_map = {}
80
81 def ast_parse(self, source, filename='<unknown>', symbol='exec'):
82 """Parse code to an AST with the current compiler flags active.
83
84 Arguments are exactly the same as ast.parse (in the standard library),
85 and are passed to the built-in compile function."""
86 return compile(source, filename, symbol, self.flags | PyCF_ONLY_AST, 1)
87
88 def reset_compiler_flags(self):
89 """Reset compiler flags to default state."""

Callers 3

run_cell_asyncMethod · 0.80
timeitMethod · 0.80
timeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected