dropbox / pyannotate

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

get_function_name_from_frame() has bugs #17

Open gvanrossum opened 6 years ago

gvanrossum commented 6 years ago

It's possible to get two functions in the same file with the same name. For example

class CameraNotifier(NSObject):
    def init(self):
        def register(events, center):

causes a function named "CameraNotifier.register" to be recorded, which may conflict with an actual method of the same class with the same name.

(Note that usually this is resolved in pyannotate by looking at the line numbers.)