Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __repr__ for Window class #2345

Merged
merged 4 commits into from
Jul 26, 2023
Merged

Conversation

yunline
Copy link
Contributor

@yunline yunline commented Jul 25, 2023

import pygame
from pygame._sdl2 import video

pygame.init()
pygame.display.set_mode((640,480))

win1 = video.Window.from_display_module()
win2 = video.Window("hello window")
win3 = video.Window()
win4 = video.Window()

win4.destroy()

print(win1)
print(win2)
print(win3)
print(win4)
<Window(From Display)>
<Window(id=2, title='hello window')>
<Window(id=3, title='pygame window')>
<Window(Destroyed)>

@yunline yunline added _sdl2 pygame._sdl2 video pygame.video labels Jul 25, 2023
@yunline yunline requested a review from a team as a code owner July 25, 2023 13:51
Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

src_c/window.c Outdated Show resolved Hide resolved
Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one note.

Otherwise this looks pretty straightforward. Thanks!

src_c/window.c Outdated Show resolved Hide resolved
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks

@ankith26 ankith26 merged commit 51d61a3 into pygame-community:main Jul 26, 2023
@ankith26 ankith26 added this to the 2.3.1 milestone Jul 26, 2023
@yunline yunline deleted the window-repr branch July 26, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
_sdl2 pygame._sdl2 video pygame.video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants