"Unresolved attribute reference" for monkey-patched function

PyCharm says "unresolved attribute reference" for a.f2()

class A:

    def f1(self):

        print 'f1'

def _f2(self):

    print 'f2'

A.f2 = _f2

a = A()

a.f2()

Even though this runs fine. Is this something the developers are aware of? Is it being worked on? Or is it too hard to implement?

The IntelliSense is otherwise awesome!!

1

Hello Mark,

Yes, we are aware of this problem, and no, there is no general solution for

this which can be implemented. Especially if assigning the attribute is conditional

and/or happens in another module.

PyCharm says "unresolved attribute reference" for a.f2()

class A:
> def f1(self):
> print 'f1'
> def _f2(self):
> print 'f2'
> A.f2 = _f2
> 
> a = A()
> a.f2()

Even though this runs fine. Is this something the developers are aware

of? Is it being worked on? Or is it too hard to implement?

The IntelliSense is otherwise awesome!!

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

1
Avatar
Permanently deleted user

Thanks for the reply Dmitry!

I didn't think about it being conditional. I guess there's really nothing you can do about that.

I'm not sure how it being in another module complicates the matter though; you can see if that module is included?

I'll just supress the warning then. I look forward to delving into this IDE further, looks promising!
I've been using Komodo IDE both for PHP and Python/Django, but this one seems way more intelligent.

1

请先登录再写评论。