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

fix: type annotation for callable metaclass #4179

Merged
merged 6 commits into from
Jul 18, 2023
Merged

Conversation

sirrus233
Copy link
Contributor

@sirrus233 sirrus233 commented Jul 14, 2023

A recent update to pyright has surfaced a typing bug in JSII which means (in practice) that constructs in AWS CDK are no longer statically typed when using pyright. That includes most users of VSCode.

Further details in #4118 and the linked context issue.

The fix is pretty simple. Since it's just a type annotation, not much to test. But I did build the package and confirmed that static typing is fixed after the change here is picked up.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2023

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@sirrus233 sirrus233 changed the title Fix type annotation for callable metaclass fix: type annotation for callable metaclass Jul 14, 2023
RomainMuller
RomainMuller previously approved these changes Jul 18, 2023
@mergify mergify bot dismissed RomainMuller’s stale review July 18, 2023 08:45

Pull request has been modified.

RomainMuller
RomainMuller previously approved these changes Jul 18, 2023
@mergify mergify bot dismissed RomainMuller’s stale review July 18, 2023 09:49

Pull request has been modified.

RomainMuller
RomainMuller previously approved these changes Jul 18, 2023
@RomainMuller
Copy link
Contributor

Well turns out mypy has different type-checking rules under that call (in particular, the behavior of super().__call__ there... which requires an explicit cast... I fixed that for you.

@mergify mergify bot dismissed RomainMuller’s stale review July 18, 2023 10:55

Pull request has been modified.

@RomainMuller RomainMuller merged commit 4ccbb57 into aws:main Jul 18, 2023
@sirrus233 sirrus233 deleted the typefix branch July 18, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants