How to suppress 'unresolved references' on a class with dynamic attributes?

I have a fairly annoying issue with a class X for which it's instances have a lot of dynamic attrs.

Everywhere I use it's attributes I get 'unresolved references'. Now I understand this is not easily detectable through code analysis, but what I actually need is suppressing these errors in the most efficient way.

Currently as far I can see it's possible to supress on statement level OR class level with

#noinspection PyUnresolvedReferences

However this is working only on the "user" classes, so I'd have to add that every class/code in which some instances of class X are used.

Is it possible to suppress all unresolved references on the actual class which has those dynamic attrs?

Note: Basically like @DynamicAttrs in Pydev

Thanks in advance for any info on this!

2 comments
Comment actions Permalink

Hello Béres,

Right now the only possibilities you have is to suppress the inspection at

usage site or to add the names of the dynamically created attributes to the

list of ignored identifiers in the inspection settings. You're welcome to

file a feature request at http://youtrack.jetbrains.net/ asking to support

pydev's @DynamicAttrs.

I have a fairly annoying issue with a class X for which it's instances

have a lot of dynamic attrs.

Everywhere I use it's attributes I get 'unresolved references'. Now I

understand this is not easily detectable through code analysis, but

what I actually need is suppressing these errors in the most efficient

way.

Currently as far I can see it's possible to supress on statement level

OR class level with #noinspection PyUnresolvedReferences

However this is working only on the "user" classes, so I'd have to add

that every class/code in which some instances of class X are used.

Is it possible to suppress all unresolved references on the actual

class which has those dynamic attrs?

Note: Basically like @DynamicAttrs in Pydev

Thanks in advance for any info on this!

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Ok, thanks for your timely answer.

I've opened a feature request regarding this at http://youtrack.jetbrains.net/issue/PY-4600?projectKey=PY

0

Please sign in to leave a comment.