landscapeio / landscape-issues

The public issue tracker for Landscape.io (https://landscape.io)
15 stars 1 forks source link

Inconsistencies with wrongly detecting a "not a callback" error #270

Closed nirizr closed 4 years ago

nirizr commented 7 years ago

I have a callable object (I dubbed logger), and landscape occasionally detect calling it as a not callback, although it is. At other times logger is indeed identified as a callable, and instead a valid error (which I simply didn't address yet) is raised instead.

I expect intended behavior to be that the incorrect ("not callable") is never raised as it is incorrect. Additionally, I assume inconsistency is also an issue here (although of secondary importance).

timsavage commented 7 years ago

I have a similar issue although in my case the callable is explicitly checked as a callable eg:

if callable(my_var):
    value = my_var(value)

Causes the error "is not callable"...

nirizr commented 7 years ago

FWIW, it turned out I was using the same name for a module. Once I changed the name of my callable the inconsistency stopped. I know it shouldn't happen but the workaround was good enough for me, it might help you as well.