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

colorama: re-export just_fix_windows_console at top level #9234

Merged
merged 2 commits into from
Nov 21, 2022

Conversation

njsmith
Copy link
Contributor

@njsmith njsmith commented Nov 21, 2022

Added here: tartley/colorama#352

Re-export can be seen here:

https://github.com/tartley/colorama/blob/21c4b94fe21ce29c85c896ace828da24b7527641/colorama/__init__.py#L2

I don't know why all the exports are "X as X" instead of just "X", but I followed the same style for consistency.

njsmith and others added 2 commits November 21, 2022 01:23
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

I don't know why all the exports are "X as X" instead of just "X", but I followed the same style for consistency.

In stubs, all imports are generally considered by type checkers to be "private to the stub" (I.e., they generally don't represent a symbol that's being exported, that an end user of the stubs would be able to access). Using the "redundant" from foo import bar as bar idiom is one of several ways PEP 484 lays out to indicate to a type checker that these imports are in fact public re-exports that an end user would be able to use at runtime.

TL;DR: You did the right thing.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit c161827 into python:main Nov 21, 2022
@njsmith njsmith deleted the colorama-just-fix-windows-console branch November 21, 2022 10:28
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