mdickinson / refcycle

Support for displaying and analyzing reference graphs of Python objects.
Apache License 2.0
15 stars 1 forks source link

In Python 2, support annotation of bound methods with no im_class. #56

Closed mdickinson closed 7 years ago

mdickinson commented 7 years ago

This PR resolves a Python 2 only issue where annotation failed for bound method objects whose im_class attribute was None.

The actual object that this failed on was an IPython InteractiveShell.pre_prompt_hook method, but it's possible to create such bound methods using types.MethodType, by omitting the third argument.