mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-28 04:37:32 +07:00
Previously, unresolved class attributes were not reported for the decorated classes because of potential dynamical attributes (see PY-7173). This commit enables this warning again because false-negative unresolved reference warning is much more common and distracting than the case with dynamic attributes Merge-request: IJ-MR-105254 Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com> GitOrigin-RevId: 67d1ab3fe1d5a140836d49f8ef6a65cf01873456
24 lines
445 B
Python
24 lines
445 B
Python
class C(object):
|
|
def foo(self):
|
|
self.bar = 1
|
|
|
|
baz = 2
|
|
|
|
@property
|
|
def quux(self):
|
|
return 3
|
|
|
|
def decorator(c):
|
|
return c
|
|
|
|
@decorator
|
|
class D(object):
|
|
foo = 1
|
|
|
|
c = C()
|
|
print(c.bar, c.baz, c.quux)
|
|
print(c.<warning descr="Unresolved attribute reference 'spam' for class 'C'">spam</warning>) #fail
|
|
d = D()
|
|
print(d.foo)
|
|
print(d.<warning descr="Unresolved attribute reference 'eggs' for class 'D'">eggs</warning>)
|