dropbox / pyannotate

Auto-generate PEP-484 annotations
Apache License 2.0
1.42k stars 59 forks source link

pyannotate won't annotate methods with args-only keywords #31

Closed rowillia closed 6 years ago

rowillia commented 6 years ago

Repro: Modify gcd.py in the example directory to the following:

def main():
    print(gcd(15, b=10))
    print(gcd(45, b=12))

def gcd(a, *, b):
    while b:
        a, b = b, a%b
    return a

and run

$ python driver.py
5
3
$ pyannotate -w gcd.py
No files need to be modified.
Warnings/messages while refactoring:
### In file gcd.py ###
gcd.py:6: source has 2 args, annotation has 3 -- skipping
gvanrossum commented 6 years ago

You're right. Do you have the patience to submit a fix?

rowillia commented 6 years ago

@gvanrossum Yup, attached. Thanks!