clean of unnecessary checks, imports, calls (#7993)

This commit is contained in:
Mark Mayo
2022-11-21 00:00:27 +13:00
committed by GitHub
parent a25c53e8b0
commit f32d611689
27 changed files with 44 additions and 57 deletions

View File

@ -60,7 +60,11 @@ def quantum_full_adder(
...
ValueError: inputs must be less or equal to 2.
"""
if (type(input_1) == str) or (type(input_2) == str) or (type(carry_in) == str):
if (
isinstance(input_1, str)
or isinstance(input_2, str)
or isinstance(carry_in, str)
):
raise TypeError("inputs must be integers.")
if (input_1 < 0) or (input_2 < 0) or (carry_in < 0):