def attack(self, target): self.validify() if not isinstance(target, Unit): raise TypeError('target should be of [Unit]') target.validify() return library.botAttack(self.ptr, target.ptr)
def attack(self, target): self.validify() if target.__class__ not in [Unit]: raise TypeError('target should be of [Unit]') target.validify() return library.botAttack(self.ptr, target.ptr)