Skip to content

Commit 1e47d53

Browse files
committed
Added more / (positional-only notation)
Mostly affected `pygame.geometry`
1 parent b0e20ee commit 1e47d53

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

buildconfig/stubs/pygame/geometry.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,34 @@ class Circle:
6666
@overload
6767
def __init__(self, circle: _CircleValue) -> None: ...
6868
@overload
69-
def move(self, x: float, y: float) -> Circle: ...
69+
def move(self, x: float, y: float, /) -> Circle: ...
7070
@overload
71-
def move(self, move_by: Coordinate) -> Circle: ...
71+
def move(self, move_by: Coordinate, /) -> Circle: ...
7272
@overload
73-
def move_ip(self, x: float, y: float) -> None: ...
73+
def move_ip(self, x: float, y: float, /) -> None: ...
7474
@overload
75-
def move_ip(self, move_by: Coordinate) -> None: ...
75+
def move_ip(self, move_by: Coordinate, /) -> None: ...
7676
@overload
77-
def collidepoint(self, x: float, y: float) -> bool: ...
77+
def collidepoint(self, x: float, y: float, /) -> bool: ...
7878
@overload
79-
def collidepoint(self, point: Coordinate) -> bool: ...
79+
def collidepoint(self, point: Coordinate, /) -> bool: ...
8080
@overload
81-
def collidecircle(self, circle: _CircleValue) -> bool: ...
81+
def collidecircle(self, circle: _CircleValue, /) -> bool: ...
8282
@overload
83-
def collidecircle(self, x: float, y: float, r: float) -> bool: ...
83+
def collidecircle(self, x: float, y: float, r: float, /) -> bool: ...
8484
@overload
85-
def collidecircle(self, center: Coordinate, r: float) -> bool: ...
85+
def collidecircle(self, center: Coordinate, r: float, /) -> bool: ...
8686
@overload
87-
def colliderect(self, rect: RectValue) -> bool: ...
87+
def colliderect(self, rect: RectValue, /) -> bool: ...
8888
@overload
89-
def colliderect(self, x: float, y: float, w: float, h: float) -> bool: ...
89+
def colliderect(self, x: float, y: float, w: float, h: float, /) -> bool: ...
9090
@overload
91-
def colliderect(self, topleft: Coordinate, size: Coordinate) -> bool: ...
91+
def colliderect(self, topleft: Coordinate, size: Coordinate, /) -> bool: ...
9292
@overload
93-
def update(self, circle: _CircleValue) -> None: ...
93+
def update(self, circle: _CircleValue, /) -> None: ...
9494
@overload
95-
def update(self, x: float, y: float, r: float) -> None: ...
95+
def update(self, x: float, y: float, r: float, /) -> None: ...
9696
@overload
97-
def update(self, center: Coordinate, r: float) -> None: ...
97+
def update(self, center: Coordinate, r: float, /) -> None: ...
9898
def __copy__(self) -> Circle: ...
9999
copy = __copy__

docs/reST/ref/geometry.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
.. method:: collidepoint
148148

149149
| :sl:`test if a point is inside the circle`
150-
| :sg:`collidepoint((x, y)) -> bool`
151-
| :sg:`collidepoint(x, y) -> bool`
152-
| :sg:`collidepoint(Vector2) -> bool`
150+
| :sg:`collidepoint((x, y), /) -> bool`
151+
| :sg:`collidepoint(x, y, /) -> bool`
152+
| :sg:`collidepoint(vector2, /) -> bool`
153153
154154
The `collidepoint` method tests whether a given point is inside the `Circle`
155155
(including the edge of the `Circle`). It takes a tuple of (x, y) coordinates, two
@@ -161,9 +161,9 @@
161161
.. method:: collidecircle
162162

163163
| :sl:`test if two circles collide`
164-
| :sg:`collidecircle(Circle) -> bool`
165-
| :sg:`collidecircle(x, y, radius) -> bool`
166-
| :sg:`collidecircle((x, y), radius) -> bool`
164+
| :sg:`collidecircle(circle, /) -> bool`
165+
| :sg:`collidecircle(x, y, radius, /) -> bool`
166+
| :sg:`collidecircle((x, y), radius, /) -> bool`
167167
168168
The `collidecircle` method tests whether two `Circle` objects overlap. It takes either
169169
a `Circle` object, a tuple of (x, y) coordinates and a radius, or separate x and y
@@ -179,9 +179,9 @@
179179
.. method:: move
180180

181181
| :sl:`moves the circle by a given amount`
182-
| :sg:`move((x, y)) -> Circle`
183-
| :sg:`move(x, y) -> Circle`
184-
| :sg:`move(Vector2) -> Circle`
182+
| :sg:`move((x, y), /) -> Circle`
183+
| :sg:`move(x, y, /) -> Circle`
184+
| :sg:`move(vector2, /) -> Circle`
185185
186186
The `move` method allows you to create a new `Circle` object that is moved by a given
187187
offset from the original `Circle`. This is useful if you want to move a `Circle` without
@@ -201,9 +201,9 @@
201201
.. method:: move_ip
202202

203203
| :sl:`moves the circle by a given amount, in place`
204-
| :sg:`move_ip((x, y)) -> None`
205-
| :sg:`move_ip(x, y) -> None`
206-
| :sg:`move_ip(Vector2) -> None`
204+
| :sg:`move_ip((x, y), /) -> None`
205+
| :sg:`move_ip(x, y, /) -> None`
206+
| :sg:`move_ip(vector2, /) -> None`
207207
208208
The `move_ip` method is similar to the move method, but it moves the `Circle` in place,
209209
modifying the original `Circle` object. This method takes the same types of arguments
@@ -222,10 +222,10 @@
222222
.. method:: colliderect
223223

224224
| :sl:`checks if a rectangle intersects the circle`
225-
| :sg:`colliderect(Rect) -> bool`
226-
| :sg:`colliderect((x, y, width, height)) -> bool`
227-
| :sg:`colliderect(x, y, width, height) -> bool`
228-
| :sg:`colliderect((x, y), (width, height)) -> bool`
225+
| :sg:`colliderect(rect, /) -> bool`
226+
| :sg:`colliderect((x, y, width, height), /) -> bool`
227+
| :sg:`colliderect(x, y, width, height, /) -> bool`
228+
| :sg:`colliderect((x, y), (width, height), /) -> bool`
229229
230230
The `colliderect` method tests whether a given rectangle intersects the `Circle`. It
231231
takes either a `Rect` object, a tuple of (x, y, width, height) coordinates, or separate
@@ -237,8 +237,8 @@
237237
.. method:: update
238238

239239
| :sl:`updates the circle position and radius`
240-
| :sg:`update((x, y), radius) -> None`
241-
| :sg:`update(x, y, radius) -> None`
240+
| :sg:`update((x, y), radius, /) -> None`
241+
| :sg:`update(x, y, radius, /) -> None`
242242
243243
The `update` method allows you to set the position and radius of a `Circle` object in
244244
place. This method takes either a tuple of (x, y) coordinates, two separate x and

docs/reST/ref/mouse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ scroll, such as ``which`` (it will tell you what exact mouse device trigger the
230230
.. function:: set_relative_mode
231231

232232
| :sl:`set relative mouse mode`
233-
| :sg:`set_relative_mode(enable) -> None`
233+
| :sg:`set_relative_mode(enable, /) -> None`
234234
235235
Sets the relative mouse mode state.
236236
While the mouse is in relative mode, the cursor is hidden,

0 commit comments

Comments
 (0)