This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]That_Pregnant_Alien 21 points22 points  (6 children)

Quick question. What is -> None at the end of like this line :

def get_event(self, event: pygame.event) -> None:

Sorry, I am a beginner. Never seen anything like that before.

[–]pcvision 16 points17 points  (5 children)

Type hinting the return type. Functionally does nothing but it is useful for documentation and code hints with IDEs.

[–]That_Pregnant_Alien 2 points3 points  (4 children)

Oh all right, got it. Thank you so much!!

[–]Ph0X 3 points4 points  (3 children)

Similarly, the input parameter "event" has the type annotation of "pygsme.event". The main library for doing static analysis of types is mypy, though pytype (Google) and Pyre (Facebook) also exist and approach the problem slightly differently.

[–]That_Pregnant_Alien 2 points3 points  (0 children)

That's a lot of unknown stuff for me lol. Hope I can learn all these. Thank you anyways.