shairubin / fun_with_ast

let's have fun manipulating ASTs in Python
Apache License 2.0
0 stars 1 forks source link

NotImplementedError('special characters besides \\n or \\t in string body are not supported yet') #252

Closed shairubin closed 4 months ago

shairubin commented 4 months ago

def get_type_line(source):

type_pattern = re.compile("# type:\\ ignore(\\[[a-zA-Z-]+\\])?$")

if len(type_lines) == 0:
    wrong_type_pattern = re.compile("#[\t ]*type[\t ]*(?!: ignore(\\[.*\\])?$):")