Skip to content

Commit 6b1cef0

Browse files
Fixed some typing errors. (#1419)
1 parent 5476dfe commit 6b1cef0

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

arcade/application.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def background_color(self) -> Color:
258258
def background_color(self, value: Color):
259259
self._background_color = value
260260

261-
def run(self):
261+
def run(self) -> None:
262262
"""
263263
Run the main loop.
264264
After the window has been set up, and the event hooks are in place, this is usually one of the last
@@ -295,7 +295,7 @@ def set_fullscreen(self,
295295
"""
296296
super().set_fullscreen(fullscreen, screen, mode, width, height)
297297

298-
def center_window(self):
298+
def center_window(self) -> None:
299299
"""
300300
Center the window on the screen.
301301
"""

arcade/camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def update(self):
226226
self.moving = False
227227
self._set_view_matrix() # this will alse set the combined matrix
228228

229-
def use(self):
229+
def use(self) -> None:
230230
"""
231231
Select this camera for use. Do this right before you draw.
232232
"""

arcade/gl/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ def program(
10171017
varyings_capture_mode=varyings_capture_mode,
10181018
)
10191019

1020-
def query(self, *, samples=True, time=True, primitives=True):
1020+
def query(self, *, samples=True, time=True, primitives=True) -> Query:
10211021
"""
10221022
Create a query object for measuring rendering calls in opengl.
10231023

arcade/gui/ui_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def _do_render(self, force=False):
192192

193193
self._rendered = True
194194

195-
def enable(self):
195+
def enable(self) -> None:
196196
"""
197197
Registers handler functions (`on_...`) to :py:attr:`arcade.gui.UIElement`
198198
@@ -216,7 +216,7 @@ def enable(self):
216216
self.on_text_motion_select,
217217
)
218218

219-
def disable(self):
219+
def disable(self) -> None:
220220
"""
221221
Remove handler functions (`on_...`) from :py:attr:`arcade.Window`
222222
@@ -243,7 +243,7 @@ def disable(self):
243243
def on_update(self, time_delta):
244244
return self.dispatch_ui_event(UIOnUpdateEvent(self, time_delta))
245245

246-
def draw(self):
246+
def draw(self) -> None:
247247
# Request Widgets to prepare for next frame
248248
self._do_layout()
249249

arcade/gui/widgets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def _walk_parents(self) -> Iterable[Union["UIWidget", "UIManager"]]:
344344
if parent:
345345
yield parent # type: ignore
346346

347-
def trigger_full_render(self):
347+
def trigger_full_render(self) -> None:
348348
"""In case a widget uses transparent areas or was moved,
349349
it might be important to request a full rendering of parents"""
350350
self.trigger_render()

arcade/paths_python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def has_line_of_sight(point_1: Point,
99
point_2: Point,
1010
walls: SpriteList,
1111
max_distance: int = -1,
12-
check_resolution: int = 2):
12+
check_resolution: int = 2) -> bool:
1313
"""
1414
Determine if we have line of sight between two points. Try to make sure
1515
that spatial hashing is enabled on the wall SpriteList or this will be

arcade/window_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def timer_resolution(msecs=0):
326326
pyglet.app.run(window._draw_rate)
327327

328328

329-
def exit():
329+
def exit() -> None:
330330
"""
331331
Exits the application.
332332
"""
@@ -368,7 +368,7 @@ def set_background_color(color: Color) -> None:
368368
get_window().background_color = color
369369

370370

371-
def schedule(function_pointer: Callable, interval: Number):
371+
def schedule(function_pointer: Callable, interval: float):
372372
"""
373373
Schedule a function to be automatically called every ``interval``
374374
seconds. The function/callable needs to take a delta time argument
@@ -391,7 +391,7 @@ def some_action(delta_time):
391391
# Unschedule
392392
393393
:param Callable function_pointer: Pointer to the function to be called.
394-
:param Number interval: Interval to call the function (float or integer)
394+
:param float interval: Interval to call the function (float or integer)
395395
"""
396396
pyglet.clock.schedule_interval(function_pointer, interval)
397397

0 commit comments

Comments
 (0)