Skip to content

Commit 3a12dcf

Browse files
committed
Switch to use isinstance where possible
1 parent 5f58029 commit 3a12dcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_fram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def write_wraparound(self) -> bool:
9090
return self._wraparound
9191

9292
@write_wraparound.setter
93-
if not value in (True, False):
9493
def write_wraparound(self, value: bool) -> None:
94+
if not isinstance(value, bool):
9595
raise ValueError("Write wraparound must be 'True' or 'False'.")
9696
self._wraparound = value
9797

@@ -295,8 +295,8 @@ def _write(self, start_address: int, data: Union[int, Sequence[int]], wraparound
295295

296296
# pylint: disable=no-member
297297
@FRAM.write_protected.setter
298-
if value not in (True, False):
299298
def write_protected(self, value: bool) -> None:
299+
if not isinstance(value, bool):
300300
raise ValueError("Write protected value must be 'True' or 'False'.")
301301
self._wp = value
302302
if not self._wp_pin is None:

0 commit comments

Comments
 (0)