MCPcopy Create free account
hub / github.com/ipython/ipython / ast_parse

Method ast_parse

IPython/core/compilerop.py:96–101  ·  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

94
95
96 def ast_parse(self, source, filename='<unknown>', symbol='exec'):
97 """Parse code to an AST with the current compiler flags active.
98
99 Arguments are exactly the same as ast.parse (in the standard library),
100 and are passed to the built-in compile function."""
101 return compile(source, filename, symbol, self.flags | PyCF_ONLY_AST, 1)
102
103 def reset_compiler_flags(self):
104 """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