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

Add type hints in trame/app/__init__.py #541

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

kmarchais
Copy link
Contributor

This PR adds type hints to the trame/app/__init__.py file so that get_client and get_server have type hints.

@jourdain
Copy link
Collaborator

jourdain commented Jun 19, 2024

Looks good, thanks for your contribution. I will rework the commit message so the CI can capture your contribution to the changelog and trigger a new version.

@jourdain jourdain merged commit 4d6d6b2 into Kitware:master Jun 19, 2024
5 of 6 checks passed

logger = logging.getLogger(__name__)

set_default_client_type("vue3")


def apply_client_type(server, client_type=None):
def apply_client_type(server: Server, client_type: str | None = None) -> Server:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe client_type: Literal["vue2", "vue3"] instead of str?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I guess that will be more precise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about this late change, should I open a new PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but are you planning for other API typing? If so, you may want to bundle that with some more changes...

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.

None yet

2 participants