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 missing type hints for @content_component #1146

Merged
merged 2 commits into from
Dec 14, 2024

Conversation

richard-to
Copy link
Collaborator

I checked @component again and that seems to work. It was only @content_component which was not showing the type hints.

Not sure why removing the annotation made it so thecustom component's annotations showed up.

Before

Screenshot 2024-12-11 at 6 04 35 PM

After

Screenshot 2024-12-11 at 6 04 55 PM

Closes #912

I checked @component again and that seems to work. It was only
@content_component which was not showing the type hints.

Not sure why removing the annotation made it so thecustom component's
annotations showed up.

Closes google#912
@richard-to
Copy link
Collaborator Author

Ugh...

@wwwillchen
Copy link
Collaborator

I don't think removing the type annotations is the right solution. Take a look at how @component is implemented. I think we need TypeVar and use it as a param and return value.

@richard-to
Copy link
Collaborator Author

I don't think removing the type annotations is the right solution. Take a look at how https://github.com/component is implemented. I think we need TypeVar and use it as a param and return value.

Yeah looks that way. I find those annotations a bit hard to read. But yeah updated it with the TypeVar stuff. Claude (er...Gemini) explained the usage well enough.

@richard-to richard-to merged commit a6efb85 into google:main Dec 14, 2024
6 checks passed
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.

No typing for functions wrapped by @me.component and @me.content_component
2 participants