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

Python: JSIIMeta uses Any type instead of TypeVar variable #4118

Closed
michelesr opened this issue May 23, 2023 · 4 comments
Closed

Python: JSIIMeta uses Any type instead of TypeVar variable #4118

michelesr opened this issue May 23, 2023 · 4 comments
Labels
bug This issue is a bug. p1

Comments

@michelesr
Copy link

michelesr commented May 23, 2023

Describe the bug

To work correctly with static type checker, it should use a TypeVar.

Please check this issue comment for more information.

Expected Behavior

T = TypeVar("T")
class JSIIMeta:
     ...
    def __call__(cls: Type[T], *args: Any, **kwargs) -> T:

Current Behavior

class JSIIMeta:
     ...
    def __call__(cls: Type[Any], *args: Any, **kwargs) -> Any:

Reproduction Steps

N/A

Possible Solution

See proposed snippet

Additional Information/Context

No response

SDK version used

N/A

Environment details (OS name and version, etc.)

N/A

@michelesr michelesr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 23, 2023
@michelesr michelesr changed the title Python: JSIIMeta returns Any type instead of TypeVar variable Python: JSIIMeta uses Any type instead of TypeVar variable May 23, 2023
@ThomasSteinbach
Copy link

It would be nice, if someone could address this issue.
In VSCode with the latest version of Pylance installed, all the magic of typing and suggestions didn't work anymore.

Bildschirmfoto 2023-06-26 um 10 23 14

@sirrus233
Copy link
Contributor

Can we get some sort of ACK that this issue has been recognized? It significantly impacts the usability of CDK.

@sirrus233
Copy link
Contributor

This can be closed, with the release of JSII 1.86

@mrgrain mrgrain added p1 and removed needs-triage This issue or PR still needs to be triaged. labels Apr 9, 2024
@mrgrain mrgrain closed this as completed Apr 9, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p1
Projects
None yet
Development

No branches or pull requests

4 participants