dropbox / pyannotate

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

Infer base classes in signatures #7

Open JukkaL opened 6 years ago

JukkaL commented 6 years ago

If a function gets called with two different argument types A and B that have a common base class C, we may want to infer C as the argument type instead of Union[A, B] -- unless C is object or some other type that isn't interesting.

To implement this, we could record the MROs of all types in the profile.