class A:
    pass

a = A()
print(a.f<caret>oo)

x = A() or None
print(x.foo)
class A:
    pass

a = A()
print(a.f<caret>oo)

def func(c):
    x = A() if c else None
    return x.foo
Use more reliable test data as pointed in IDEA-COMMUNITY-CR-936
Use more reliable test data as pointed in IDEA-COMMUNITY-CR-936

  class A:
      pass
  
  a = A()
  print(a.f<caret>oo)
  
- x = A() or None
- print(x.foo)
+ def func(c):
+     x = A() if c else None
+     return x.foo
Use more reliable test data as pointed in IDEA-COMMUNITY-CR-936
## Code Before:
class A:
    pass

a = A()
print(a.f<caret>oo)

x = A() or None
print(x.foo)
## Instruction:
Use more reliable test data as pointed in IDEA-COMMUNITY-CR-936
## Code After:
class A:
    pass

a = A()
print(a.f<caret>oo)

def func(c):
    x = A() if c else None
    return x.foo