hoffstadt / hoffstadt/DearPyGui

Add missing type hints to kwargs on all function calls

Open
#1,909 1 comment 0 reactions 0 assignees View on GitHub
priority: medium type: docs type: improvement
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.7.1
Operating System: Win10

## My Issue/Question
Pylance/VSCode is giving me a hard time about missing type hints for kwargs on all function declarations in strict mode (it carries through into my code because it doesn't like the fact I'm calling what it thinks is a partially un-type-defined function. Luckily, the fix is pretty simple; changing every `**kwargs` in a function definition to `**kwargs: Any` will resolve the problem for many functions; others will require adding parameters to Callable. I don't yet know the library well enough to know what these should be -- it depends on what the callbacks are, but possibly `Callable[..., None]` would work if nothing is returned and 0-3 args of any type can be passed in.

## To Reproduce

N/A

## Expected behavior

N/A

## Screenshots/Video

N/A
## Standalone, minimal, complete and verifiable example

Before:

```
def configure_app(**kwargs) -> None:
"""Configures an item after creation."""
internal_dpg.configure_app(**kwargs)
```
After:

```
def configure_app(**kwargs: Any) -> None:
"""Configures an item after creation."""
internal_dpg.configure_app(**kwargs)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.