google / pasta

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

Extend scope.analyze to support PEP 484 forward references #84

Closed soupytwist closed 3 years ago

soupytwist commented 3 years ago

https://www.python.org/dev/peps/pep-0484/#forward-references

This style of type annotation isn't recognized by scope.analyze right now. The b imported in this module appears to be unused.

# File models/a.py
from models import b
class A(Model):
    def foo(self, b: 'b.B'): ...