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 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", "0", "rc3")
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__(self, callback: Callable[[], T] | None) -> None: ...
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