Skip to content

Commit 6bb80ef

Browse files
committed
Fix some formatting and stub issues
1 parent 8edbcaf commit 6bb80ef

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

buildconfig/stubs/pygame/display.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ def flip() -> None:
289289
@overload
290290
def update() -> None: ...
291291
@overload
292-
def update(
293-
rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]], /
294-
) -> None: ...
292+
def update(rectangle: Optional[RectLike], /) -> None: ...
293+
@overload
294+
def update(rectangles: Iterable[Optional[RectLike]], /) -> None: ...
295295
@overload
296296
def update(x: float, y: float, w: float, h: float, /) -> None: ...
297297
@overload
@@ -333,7 +333,7 @@ def get_driver() -> str:
333333
initialized. This returns the internal name used for the display backend.
334334
This can be used to provide limited information about what display
335335
capabilities might be accelerated. See the ``SDL_VIDEODRIVER`` flags in
336-
``pygame.display.set_mode()`` to see some of the common options.
336+
``pygame.display.init()`` to see some of the common options.
337337
"""
338338

339339
def Info() -> _VidInfo:
@@ -612,7 +612,7 @@ def toggle_fullscreen() -> int:
612612
"""
613613

614614
@deprecated("since 2.1.4. Removed in SDL3")
615-
def set_gamma(red: float, green: float = ..., blue: float = ..., /) -> int:
615+
def set_gamma(red: float, green: float = ..., blue: float = ..., /) -> bool:
616616
"""Change the hardware gamma ramps.
617617
618618
DEPRECATED: This functionality will go away in SDL3.
@@ -631,7 +631,7 @@ def set_gamma(red: float, green: float = ..., blue: float = ..., /) -> int:
631631
@deprecated("since 2.1.4. Removed in SDL3")
632632
def set_gamma_ramp(
633633
red: SequenceLike[int], green: SequenceLike[int], blue: SequenceLike[int], /
634-
) -> int:
634+
) -> bool:
635635
"""Change the hardware gamma ramps with a custom lookup.
636636
637637
DEPRECATED: This functionality will go away in SDL3.
@@ -825,7 +825,7 @@ def message_box(
825825
:param str title: A title string.
826826
:param str message: A message string. If this parameter is set to ``None``, the message will be the title.
827827
:param str message_type: Set the type of message_box, could be ``"info"``, ``"warn"`` or ``"error"``.
828-
:param Window parent_window: The parent window of the message box.
828+
:param pygame.Window parent_window: The parent window of the message box.
829829
:param tuple buttons: An optional sequence of button name strings to show to the user.
830830
:param int return_button: Button index to use if the return key is hit, ``0`` by default.
831831
:param int escape_button: Button index to use if the escape key is hit, ``None`` for no button linked by default.

buildconfig/stubs/pygame/window.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class Window:
294294
def position(self) -> tuple[int, int]:
295295
"""Get or set the window position in screen coordinates.
296296
297-
The position may be a tuple of (x, y) coordiantes or ``WINDOWPOS_CENTERED`` or
297+
The position may be a tuple of (x, y) coordinates or ``WINDOWPOS_CENTERED`` or
298298
``WINDOWPOS_UNDEFINED``. The origin is the topleft of the main display.
299299
"""
300300

src_c/doc/display_doc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define DOC_DISPLAY_SETMODE "set_mode(size=(0, 0), flags=0, depth=0, display=0, vsync=0) -> Surface\nInitialize a window or screen for display."
77
#define DOC_DISPLAY_GETSURFACE "get_surface() -> Optional[Surface]\nGet a reference to the currently set display surface."
88
#define DOC_DISPLAY_FLIP "flip() -> None\nUpdate the full display Surface to the screen."
9-
#define DOC_DISPLAY_UPDATE "update() -> None\nupdate(rectangle, /) -> None\nupdate(x, y, w, h, /) -> None\nupdate(xy, wh, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays."
9+
#define DOC_DISPLAY_UPDATE "update() -> None\nupdate(rectangle, /) -> None\nupdate(rectangles, /) -> None\nupdate(x, y, w, h, /) -> None\nupdate(xy, wh, /) -> None\nUpdate all, or a portion, of the display. For non-OpenGL displays."
1010
#define DOC_DISPLAY_GETDRIVER "get_driver() -> str\nGet the name of the pygame display backend."
1111
#define DOC_DISPLAY_INFO "Info() -> _VidInfo\nCreate a video display information object."
1212
#define DOC_DISPLAY_GETWMINFO "get_wm_info() -> dict[str, int]\nGet information about the current windowing system."
@@ -18,8 +18,8 @@
1818
#define DOC_DISPLAY_GETACTIVE "get_active() -> bool\nReturns True when the display is active on the screen."
1919
#define DOC_DISPLAY_ICONIFY "iconify() -> bool\nIconify the display surface."
2020
#define DOC_DISPLAY_TOGGLEFULLSCREEN "toggle_fullscreen() -> int\nSwitch between fullscreen and windowed displays."
21-
#define DOC_DISPLAY_SETGAMMA "set_gamma(red, green=..., blue=..., /) -> int\nChange the hardware gamma ramps."
22-
#define DOC_DISPLAY_SETGAMMARAMP "set_gamma_ramp(red, green, blue, /) -> int\nChange the hardware gamma ramps with a custom lookup."
21+
#define DOC_DISPLAY_SETGAMMA "set_gamma(red, green=..., blue=..., /) -> bool\nChange the hardware gamma ramps."
22+
#define DOC_DISPLAY_SETGAMMARAMP "set_gamma_ramp(red, green, blue, /) -> bool\nChange the hardware gamma ramps with a custom lookup."
2323
#define DOC_DISPLAY_SETICON "set_icon(surface, /) -> None\nChange the system image for the display window."
2424
#define DOC_DISPLAY_SETCAPTION "set_caption(title, icontitle=None, /) -> None\nSet the current window caption."
2525
#define DOC_DISPLAY_GETCAPTION "get_caption() -> tuple[str, str]\nGet the current window caption."

0 commit comments

Comments
 (0)