You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""This function is just a convenience wrapper around ast.parse, with default flags useful to Mypy.
144
-
It also incorporates a hack to accomodate `# mypy: ignore` comments, which are treated by mypy as `# type: ignore` comments."""
144
+
It also incorporates a hack to accomodate `# mypy: ignore` comments, which are treated by mypy as `# type: ignore` comments.
145
+
"""
145
146
# Hack to support "mypy: ignore" comments until the builtin compile function changes to allow us to detect it otherwise:
146
147
# (Note: completely distinct from https://mypy.readthedocs.io/en/stable/inline_config.html ; see also, util.get_mypy_comments in this codebase)
147
148
@@ -150,15 +151,19 @@ def ast3_parse(
150
151
# Note that the functions in this module are only designed to parse syntactically valid Python code (code that does not raise when parsed using ast.parse()). The behavior of the functions in this module is **undefined** when providing invalid Python code and it can change at any point.
151
152
# So, we cannot rely on roundtrip behavior in tokenize iff ast.parse would throw when given `source`.
152
153
# The simplest way to deal with that is just to call ast.parse twice, once before and once after. So, we do that.
0 commit comments