IssueRaiser

Add type hints for signal parameters

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> See https://github.com/godotengine/godot/issues/26045 ### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project Signals don't have type hints, meaning helper docs are bad and runtime exceptions are more probable ### Describe the feature / enhancement and how it helps to overcome the problem or limitation Type hint syntax for signal declarations, similar to function signatures ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams ```py signal released(player: Player) ``` ![image](https://user-images.githubusercontent.com/14253836/113663615-f58b1080-966f-11eb-89c8-b86f138ded1c.png) ### If this enhancement will not be used often, can it be worked around with a few lines of script? This will be used often. ### Is there a reason why this should be core and not an add-on in the asset library? Signals are part of core

Posted by nathanfranke on Apr 6, 2021, 5:38 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Software)

Add type hints for signal parameters

nathanfrankeApr 6, 2021, 5:38 AM

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> See https://github.com/godotengine/godot/issues/26045 ### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project Signals don't have type hints, meaning helper docs are bad and runtime exceptions are more probable ### Describe the feature / enhancement and how it helps to overcome the problem or limitation Type hint syntax for signal declarations, similar to function signatures ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams ```py signal released(player: Player) ``` ![image](https://user-images.githubusercontent.com/14253836/113663615-f58b1080-966f-11eb-89c8-b86f138ded1c.png) ### If this enhancement will not be used often, can it be worked around with a few lines of script? This will be used often. ### Is there a reason why this should be core and not an add-on in the asset library? Signals are part of core

Comments (0)

No comments yet. Start the discussion.

Comment on this issue