wrapt 2.0.0rc3__cp314-cp314t-macosx_11_0_arm64.whl → 2.0.1__cp314-cp314t-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wrapt/__init__.py +2 -1
- wrapt/__init__.pyi +8 -1
- wrapt/__wrapt__.py +4 -0
- wrapt/_wrappers.c +589 -92
- wrapt/_wrappers.cpython-314t-darwin.so +0 -0
- wrapt/proxies.py +106 -20
- wrapt/wrappers.py +74 -25
- wrapt-2.0.1.dist-info/METADATA +216 -0
- wrapt-2.0.1.dist-info/RECORD +18 -0
- wrapt-2.0.0rc3.dist-info/METADATA +0 -198
- wrapt-2.0.0rc3.dist-info/RECORD +0 -18
- {wrapt-2.0.0rc3.dist-info → wrapt-2.0.1.dist-info}/WHEEL +0 -0
- {wrapt-2.0.0rc3.dist-info → wrapt-2.0.1.dist-info}/licenses/LICENSE +0 -0
- {wrapt-2.0.0rc3.dist-info → wrapt-2.0.1.dist-info}/top_level.txt +0 -0
wrapt/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Wrapt is a library for decorators, wrappers and monkey patching.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
__version_info__ = ("2", "0", "
|
|
5
|
+
__version_info__ = ("2", "0", "1")
|
|
6
6
|
__version__ = ".".join(__version_info__)
|
|
7
7
|
|
|
8
8
|
from .__wrapt__ import (
|
|
@@ -53,6 +53,7 @@ __all__ = (
|
|
|
53
53
|
"when_imported",
|
|
54
54
|
"apply_patch",
|
|
55
55
|
"function_wrapper",
|
|
56
|
+
"lazy_import",
|
|
56
57
|
"patch_function_wrapper",
|
|
57
58
|
"resolve_path",
|
|
58
59
|
"transient_function_wrapper",
|
wrapt/__init__.pyi
CHANGED
|
@@ -37,9 +37,16 @@ if sys.version_info >= (3, 10):
|
|
|
37
37
|
# LazyObjectProxy
|
|
38
38
|
|
|
39
39
|
class LazyObjectProxy(AutoObjectProxy[T]):
|
|
40
|
-
def __init__(
|
|
40
|
+
def __init__(
|
|
41
|
+
self, callback: Callable[[], T] | None, *, interface: Any = ...
|
|
42
|
+
) -> None: ...
|
|
41
43
|
|
|
44
|
+
@overload
|
|
42
45
|
def lazy_import(name: str) -> LazyObjectProxy[ModuleType]: ...
|
|
46
|
+
@overload
|
|
47
|
+
def lazy_import(
|
|
48
|
+
name: str, attribute: str, *, interface: Any = ...
|
|
49
|
+
) -> LazyObjectProxy[Any]: ...
|
|
43
50
|
|
|
44
51
|
# CallableObjectProxy
|
|
45
52
|
|
wrapt/__wrapt__.py
CHANGED
|
@@ -10,6 +10,8 @@ from .wrappers import PartialCallableObjectProxy, _FunctionWrapperBase
|
|
|
10
10
|
|
|
11
11
|
# Try to use C extensions if not disabled.
|
|
12
12
|
|
|
13
|
+
_using_c_extension = False
|
|
14
|
+
|
|
13
15
|
_use_extensions = not os.environ.get("WRAPT_DISABLE_EXTENSIONS")
|
|
14
16
|
|
|
15
17
|
if _use_extensions:
|
|
@@ -26,6 +28,8 @@ if _use_extensions:
|
|
|
26
28
|
PartialCallableObjectProxy,
|
|
27
29
|
_FunctionWrapperBase,
|
|
28
30
|
)
|
|
31
|
+
|
|
32
|
+
_using_c_extension = True
|
|
29
33
|
except ImportError:
|
|
30
34
|
# C extensions not available, using Python implementations
|
|
31
35
|
pass
|