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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mypy==0.971
packaging==21.3
pycln==2.1.1 # must match .pre-commit-config.yaml
pyyaml==6.0
pytype==2022.8.23; platform_system != "Windows"
pytype==2022.8.30; platform_system != "Windows"
termcolor
tomli==1.2.2
tomlkit==0.11.4
Expand Down
4 changes: 1 addition & 3 deletions stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from typing import Any, ClassVar, Generic, TypeVar, Union as _UnionT, overload
from typing_extensions import TypeAlias

# 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


if sys.version_info >= (3, 9):
from types import GenericAlias
Expand Down