Skip to content

Commit

Permalink
Add positional parameter support for match statement (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcaley committed May 14, 2024
1 parent 0bf964d commit 4d2e686
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyglet/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Vec2:
"""A two-dimensional vector represented as an X Y coordinate pair."""

__slots__ = 'x', 'y'
__match_args__ = 'x', 'y'

def __init__(self, x: float = 0.0, y: float = 0.0) -> None:
self.x = x
Expand Down Expand Up @@ -222,6 +223,7 @@ class Vec3:
"""A three-dimensional vector represented as X Y Z coordinates."""

__slots__ = 'x', 'y', 'z'
__match_args__ = 'x', 'y', 'z'

def __init__(self, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> None:
self.x = x
Expand Down Expand Up @@ -375,6 +377,7 @@ class Vec4:
"""A four-dimensional vector represented as X Y Z W coordinates."""

__slots__ = 'x', 'y', 'z', 'w'
__match_args__ = 'x', 'y', 'z', 'w'

def __init__(self, x: float = 0.0, y: float = 0.0, z: float = 0.0, w: float = 0.0) -> None:
self.x = x
Expand Down

0 comments on commit 4d2e686

Please sign in to comment.