Skip to content

Y026: explicitly declare type aliases as TypeAlias #349

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

Merged
merged 1 commit into from
Oct 1, 2022

Conversation

twoertwein
Copy link
Member

Closes #345

(and remove FilePathOrBuffer - it does not exist anymore in pandas)

@@ -4,4 +4,4 @@ version_json: str = ...

def get_versions(): ...

_stub_version = Literal["1.5.0.220926"]
_stub_version: Literal["1.5.0.220926"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this is needed.

If we assign Literal as a value, we need a TypeAlias, but the type alias is unused (private type aliases need to be used) which triggers another check from flake8-pyi.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Microsoft is copying the stubs over to the VS Code pylance distribution, so by having this, we can tell what version they copied over.

@twoertwein
Copy link
Member Author

Would be nice to slowly move all the TypeAliases that are not in _typing to something like __typing (no need to make things worse for #128)

@twoertwein twoertwein requested a review from Dr-Irv September 30, 2022 21:47
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

thanks @twoertwein

@Dr-Irv Dr-Irv merged commit 7bcb0c4 into pandas-dev:main Oct 1, 2022
@twoertwein twoertwein deleted the y026 branch February 10, 2024 20:31
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.

Convert typing declarations to use TypeAlias
2 participants