Skip to content

Commit 867fd2c

Browse files
committed
Update Shape classes docstrings
1 parent 1b9be59 commit 867fd2c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

utils/shape.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66

77
class Shape(object):
8-
def __init__(self, position: Vector2 | tuple[int, int]=Vector2(0, 0), color: pygame.Color | tuple[int, int, int]=(0, 0, 0)) -> None:
8+
def __init__(self, position: tuple[int, int] | Vector2=Vector2(0, 0), color: pygame.Color | tuple[int, int, int]=(0, 0, 0)) -> None:
99
"""
1010
Parameters
1111
----------
12-
position : Vector2 | tuple[int, int]
12+
position : tuple[int, int] | Vector2
1313
The position of the shape. Default is (0, 0)
1414
color : pygame.Color | tuple[int, int, int]
1515
The position of the shape. Default is black or (0, 0, 0)
@@ -31,14 +31,14 @@ def draw(self, surface: pygame.Surface):
3131

3232

3333
class Square(Shape):
34-
def __init__(self, position: Vector2| tuple[int, int]=Vector2(0, 0), size: Vector2 | tuple[int, int]=Vector2(100, 100),
34+
def __init__(self, position: tuple[int, int] | Vector2=Vector2(0, 0), size: tuple[int, int] | Vector2=Vector2(100, 100),
3535
color: pygame.Color | tuple[int, int, int]=(0, 0, 0)) -> None:
3636
"""
3737
Parameters
3838
----------
39-
position : Vector2 | tuple[int, int]
39+
position : tuple[int, int] | Vector2
4040
The position of the shape. Default is (0, 0)
41-
size : Vector2 | tuple[int, int]
41+
size : tuple[int, int] | Vector2
4242
The size of the square. Default is (100, 100)
4343
color : pygame.Color | tuple[int, int, int]
4444
The position of the shape. Default is black or (0, 0, 0)
@@ -90,11 +90,11 @@ def draw(self, surface: pygame.Surface):
9090

9191

9292
class Circle(Shape):
93-
def __init__(self, position: Vector2=Vector2(0, 0), radius: int=10, color: pygame.Color | tuple[int, int, int]=(0, 0, 0)) -> None:
93+
def __init__(self, position: tuple[int, int] | Vector2=Vector2(0, 0), radius: int=10, color: pygame.Color | tuple[int, int, int]=(0, 0, 0)) -> None:
9494
"""
9595
Parameters
9696
----------
97-
position : Vector2 | tuple[int, int]
97+
position :tuple[int, int] | Vector2
9898
The position of the shape. Default is (0, 0)
9999
radius : int
100100
The radius of the circle. Default is 10

utils/ui.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
class Color:
12+
"""
13+
Common color constants
14+
"""
1215
BLACK = pygame.color.Color(0, 0, 0)
1316
CLEAR = pygame.color.Color(0, 0, 0, 0)
1417
WHITE = pygame.color.Color(255, 255, 255)
@@ -26,6 +29,9 @@ class Color:
2629

2730

2831
class Alignment:
32+
"""
33+
Label alignment constants
34+
"""
2935
TOP_LEFT = "topleft"
3036
BOTTOM_LEFT = "bottomleft"
3137
TOP_RIGHT = "topright"

0 commit comments

Comments
 (0)