[vtk-developers] Problem with Python "hasattr"
ben.boeckel at kitware.com
Sun Aug 9 18:59:11 EDT 2015
On Sun, Aug 09, 2015 at 09:41:25 -0600, David Gobbi wrote:
> This leads to some unexpected behavior in this method from
> def __getattr__(self, name):
> "Forwards unknown attribute requests to VTK array."
> if not hasattr(self, "VTKObject") or not self.VTKObject:
> raise AttributeError("class has no attribute %s" % name)
> return getattr(self.VTKObject, name)
def __getattr__(self, name):
return getattr(self.VTKObject, name)
More information about the vtk-developers