(
source: str | bytes, filename: str, mode: str, feature_version: int = PY_MINOR_VERSION
)
| 134 | |
| 135 | |
| 136 | def ast3_parse( |
| 137 | source: str | bytes, filename: str, mode: str, feature_version: int = PY_MINOR_VERSION |
| 138 | ) -> AST: |
| 139 | # Ignore warnings that look like: |
| 140 | # <type_comment>:1: SyntaxWarning: invalid escape sequence '\.' |
| 141 | # because `source` could be anything, including literals like r'(re\.match)' |
| 142 | with warnings.catch_warnings(): |
| 143 | warnings.simplefilter("ignore", SyntaxWarning) |
| 144 | return ast3.parse( |
| 145 | source, |
| 146 | filename, |
| 147 | mode, |
| 148 | type_comments=True, # This works the magic |
| 149 | feature_version=feature_version, |
| 150 | ) |
| 151 | |
| 152 | |
| 153 | AstNode = ast3.expr | ast3.stmt | ast3.pattern | ast3.ExceptHandler |
no outgoing calls
no test coverage detected
searching dependent graphs…