Skip to content

Commit

Permalink
Remove outdated type: ignore (#2530)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeil authored Jan 31, 2025
1 parent cdd6f66 commit 333ce6e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions arcade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def configure_logging(level: int | None = None):
# Env variable shortcut for headless mode
headless: Final[bool] = bool(os.environ.get("ARCADE_HEADLESS"))
if headless:
pyglet.options.headless = headless # type: ignore # pending https://github.com/pyglet/pyglet/issues/1164
pyglet.options.headless = headless


from arcade import utils

# Disable shadow window on macs and in headless mode.
if sys.platform == "darwin" or os.environ.get("ARCADE_HEADLESS") or utils.is_raspberry_pi():
pyglet.options.shadow_window = False # type: ignore # pending https://github.com/pyglet/pyglet/issues/1164
pyglet.options.shadow_window = False

# Imports from modules that don't do anything circular

Expand Down Expand Up @@ -147,7 +147,7 @@ def configure_logging(level: int | None = None):
from .screenshot import get_pixel

# We don't have joysticks game controllers in headless mode
if not headless: # type: ignore
if not headless:
from .joysticks import get_game_controllers
from .joysticks import get_joysticks
from .controller import ControllerManager
Expand Down
8 changes: 4 additions & 4 deletions arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_screens() -> list[Screen]:
List of screens, one for each monitor.
"""
display = pyglet.display.get_display()
return display.get_screens() # type: ignore # pending: https://github.com/pyglet/pyglet/pull/1176 # noqa
return display.get_screens()


class NoOpenGLException(Exception):
Expand Down Expand Up @@ -228,9 +228,9 @@ def __init__(
style=style,
)
# pending: weird import tricks resolved
self.register_event_type("on_update") # type: ignore
self.register_event_type("on_action") # type: ignore
self.register_event_type("on_fixed_update") # type: ignore
self.register_event_type("on_update")
self.register_event_type("on_action")
self.register_event_type("on_fixed_update")
except pyglet.window.NoSuchConfigException:
raise NoOpenGLException(
"Unable to create an OpenGL 3.3+ context. "
Expand Down
2 changes: 1 addition & 1 deletion arcade/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def are_polygons_intersecting(poly_a: Point2List, poly_b: Point2List) -> bool:
max_b = projected

# Avoid typing.cast() because this is a very hot path
if max_a <= min_b or max_b <= min_a: # type: ignore
if max_a <= min_b or max_b <= min_a:
return False

return True
Expand Down
2 changes: 1 addition & 1 deletion arcade/hitbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def _adjust_point(point) -> Point2:

self._adjusted_points = [_adjust_point(point) for point in self.points]
self._adjusted_cache_dirty = False
return self._adjusted_points # type: ignore [return-value]
return self._adjusted_points


class RotatableHitBox(HitBox):
Expand Down
2 changes: 1 addition & 1 deletion arcade/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
self.bottom = bottom

if diagonal_movement:
self.movement_directions = ( # type: ignore
self.movement_directions = (
(1, 0),
(-1, 0),
(0, 1),
Expand Down

0 comments on commit 333ce6e

Please sign in to comment.