Skip to content

Commit d4a599a

Browse files
committed
code format, use more specific types than Any
1 parent f03cfc7 commit d4a599a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

adafruit_turtle.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import displayio
3535

3636
try:
37-
from typing import Any, Dict, List, Optional, Tuple, Union
37+
from typing import List, Optional, Tuple, Union
3838
except ImportError:
3939
pass
4040

@@ -149,7 +149,9 @@ class turtle:
149149
"""A Turtle that can be given commands to draw."""
150150

151151
# pylint:disable=too-many-statements
152-
def __init__(self, display: Any = None, scale: float = 1) -> None:
152+
def __init__(
153+
self, display: Optional[displayio.Display] = None, scale: float = 1
154+
) -> None:
153155
if display:
154156
self._display = display
155157
else:
@@ -649,7 +651,11 @@ def dot(self, size: Optional[int] = None, color: Optional[int] = None) -> None:
649651
self._plot(self._x, self._y, color)
650652
self._pensize = pensize
651653

652-
def stamp(self, bitmap: Optional[Any] = None, palette: Optional[Any] = None) -> int:
654+
def stamp(
655+
self,
656+
bitmap: Optional[displayio.Bitmap] = None,
657+
palette: Optional[displayio.Palette] = None,
658+
) -> int:
653659
"""
654660
Stamp a copy of the turtle shape onto the canvas at the current
655661
turtle position. Return a stamp_id for that stamp, which can be used to
@@ -1056,7 +1062,9 @@ def isvisible(self) -> bool:
10561062

10571063
# pylint:disable=too-many-statements, too-many-branches
10581064
def changeturtle(
1059-
self, source: Optional[Union[displayio.TileGrid, str]] = None, dimensions: Tuple[int, int] = (12, 12)
1065+
self,
1066+
source: Optional[Union[displayio.TileGrid, str]] = None,
1067+
dimensions: Tuple[int, int] = (12, 12),
10601068
) -> None:
10611069
"""
10621070
Change the turtle.

0 commit comments

Comments
 (0)