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

In ctypes/__init__.pyi, RTLD_GLOBAL and RTLD_LOCAL are imported from _ctypes.pyi #8657

Conversation

junkmd
Copy link
Contributor

@junkmd junkmd commented Aug 31, 2022

Thanks to google/pytype#1281 and google/pytype#1282, importing RTLD_GLOBAL and RTLD_LOCAL from _ctypes will not fail the pytype test on CI if the pytype==2022.08.30 version is specified.

Other stuffs that should be defined in _ctypes will be migrated after pytype stops using its own _ctypes stubs and starts using typeshed's _ctypes stubs.

@AlexWaygood
Copy link
Member

Thank you! Unfortunately you were slightly too slow here — I filed #8656 just five minutes before you filed this. Sorry about that :)

@github-actions
Copy link
Contributor

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

@junkmd junkmd deleted the _ctypes_add_and_migrate_stuffs_from_public_ctypes_02 branch August 31, 2022 11:23
@junkmd
Copy link
Contributor Author

junkmd commented Aug 31, 2022

@AlexWaygood
Don't mind!

It was not a big change, so it was not a problem.

# TODO: import these from _ctypes once it no longer breaks pytype
RTLD_GLOBAL: int
RTLD_LOCAL: int
from _ctypes import RTLD_GLOBAL as RTLD_GLOBAL, RTLD_LOCAL as RTLD_LOCAL
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder why isort didn't move this import near the top of the file.

Copy link
Member

Choose a reason for hiding this comment

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

Take a look at the second commit in #8656 — there's quite a few private stdlib modules that we have in typeshed that, by default, isort doesn't recognise as being part of the stdlib

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.

3 participants