def check_sw(self, sw, purpose = None): if purpose is not Card.PURPOSE_SM_OK: return Card.check_sw(self, sw, purpose) else: return sw not in ("\x69\x87", "\x69\x88")