Re: instance attribute "a" defined outside __init__
In Rio writes: > Hi, When running below code, I get error saying: > instance attribute "a" defined outside __init__ That's a warning, not an error. And it's a warning from pylint, not from Python itself. It's trying to suggest better style, that's a
instance attribute "a" defined outside __init__
Hi, When running below code, I get error saying: instance attribute "a" defined outside __init__ class Foo: var = 9 def add(self, a, b): self.a = a self.b = b print a+b def __init__(self): print 10