google / pasta

Library to refactor python code through AST manipulation.
Apache License 2.0
341 stars 40 forks source link

Fails to parse usages of metaclass #79

Closed timokau closed 4 years ago

timokau commented 4 years ago

I tried to use the tensorflow update script on a codebase that uses abstract classes with ABCMeta. Parsing failed with

AnnotationError: Expected ':' but found 'metaclass'

Minimal example:

pasta.parse('class A(metaclass=X): pass')    
soupytwist commented 4 years ago

This is some missing support for python3 syntax-- I'll add it. Thanks for the report and example!

soupytwist commented 4 years ago

Fixed at HEAD, I'll create a new version soon. Thanks again!

timokau commented 4 years ago

Wow, that was fast. Thank you!