Skip to content

Commit

Permalink
add the undocumented ctypes.macholib module (python#13086)
Browse files Browse the repository at this point in the history
  • Loading branch information
tungol authored Nov 25, 2024
1 parent d23f4ca commit d14133b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
4 changes: 0 additions & 4 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ weakref.WeakValueDictionary.update
# ==========
# TODO: Modules that exist at runtime, but are missing from stubs
# ==========
ctypes.macholib
ctypes.macholib.dyld
ctypes.macholib.dylib
ctypes.macholib.framework
encodings.aliases
encodings.ascii
encodings.base64_codec
Expand Down
1 change: 1 addition & 0 deletions stdlib/ctypes/macholib/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__: str
8 changes: 8 additions & 0 deletions stdlib/ctypes/macholib/dyld.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from collections.abc import Mapping
from ctypes.macholib.dylib import dylib_info as dylib_info
from ctypes.macholib.framework import framework_info as framework_info

__all__ = ["dyld_find", "framework_find", "framework_info", "dylib_info"]

def dyld_find(name: str, executable_path: str | None = None, env: Mapping[str, str] | None = None) -> str: ...
def framework_find(fn: str, executable_path: str | None = None, env: Mapping[str, str] | None = None) -> str: ...
14 changes: 14 additions & 0 deletions stdlib/ctypes/macholib/dylib.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import TypedDict, type_check_only

__all__ = ["dylib_info"]

# Actual result is produced by re.match.groupdict()
@type_check_only
class _DylibInfo(TypedDict):
location: str
name: str
shortname: str
version: str | None
suffix: str | None

def dylib_info(filename: str) -> _DylibInfo | None: ...
14 changes: 14 additions & 0 deletions stdlib/ctypes/macholib/framework.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import TypedDict, type_check_only

__all__ = ["framework_info"]

# Actual result is produced by re.match.groupdict()
@type_check_only
class _FrameworkInfo(TypedDict):
location: str
name: str
shortname: str
version: str | None
suffix: str | None

def framework_info(filename: str) -> _FrameworkInfo | None: ...

0 comments on commit d14133b

Please sign in to comment.