Skip to content

Commit 16daf0b

Browse files
committed
Attempt to fix mypy false positive on Union tuple types
1 parent f4ab9dd commit 16daf0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arcade/sprite/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ def color(self, color: ColorLike):
341341
self._color == color[0]
342342
and self._color[1] == color[1]
343343
and self._color[2] == color[2]
344-
and self._color[3] == color[3]
344+
# Union types set off false positives in mypy:
345+
# https://github.com/python/mypy/issues/1178
346+
and self._color[3] == color[3] # type: tuple[int, int, int, int]
345347
):
346348
return
347349
self._color = Color(color[0], color[1], color[2], color[3])

0 commit comments

Comments
 (0)