Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/wrapt/__init__.py: 90%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Wrapt is a library for decorators, wrappers and monkey patching.
3"""
6def _format_version(parts):
7 base = ".".join(parts[:3])
8 if len(parts) == 3:
9 return base
10 suffix = parts[3]
11 return (
12 f"{base}.{suffix}" if suffix.startswith(("dev", "post")) else f"{base}{suffix}"
13 )
16__version_info__ = ("2", "5", "0")
17__version__ = _format_version(__version_info__)
19from .__wrapt__ import (
20 BaseObjectProxy,
21 BoundFunctionWrapper,
22 CallableObjectProxy,
23 FunctionWrapper,
24 PartialCallableObjectProxy,
25 partial,
26)
27from .caching import lru_cache
28from .decorators import (
29 AdapterFactory,
30 adapter_factory,
31 bind_state_to_wrapper,
32 decorator,
33)
34from .doc import with_doc
35from .exceptions import (
36 PathResolutionError,
37 TargetModuleNotFoundError,
38 WrapperChainTooDeepError,
39 WrapperNotFoundError,
40 WrapperNotInitializedError,
41 WrapperNotOutermostError,
42)
43from .importer import (
44 discover_post_import_hooks,
45 notify_module_loaded,
46 register_post_import_hook,
47 when_imported,
48)
49from .patches import (
50 MISSING,
51 AttributeWrapper,
52 apply_patch,
53 find_wrapper,
54 function_wrapper,
55 is_wrapped_by,
56 patch_function_wrapper,
57 resolve_owner,
58 resolve_path,
59 scoped_function_wrapper,
60 transient_function_wrapper,
61 unwrap_object,
62 unwrapped,
63 wrap_function_wrapper,
64 wrap_object,
65 wrap_object_attribute,
66 wrapper_chain,
67)
68from .proxies import AutoObjectProxy, LazyObjectProxy, ObjectProxy, lazy_import
69from .signature import with_signature
70from .synchronization import (
71 async_to_sync,
72 mark_as_async,
73 mark_as_sync,
74 sync_to_async,
75 synchronized,
76)
77from .weakrefs import WeakFunctionProxy
79__all__ = (
80 "AutoObjectProxy",
81 "BaseObjectProxy",
82 "BoundFunctionWrapper",
83 "CallableObjectProxy",
84 "FunctionWrapper",
85 "LazyObjectProxy",
86 "ObjectProxy",
87 "PartialCallableObjectProxy",
88 "PathResolutionError",
89 "TargetModuleNotFoundError",
90 "WrapperChainTooDeepError",
91 "WrapperNotFoundError",
92 "WrapperNotInitializedError",
93 "WrapperNotOutermostError",
94 "partial",
95 "AdapterFactory",
96 "adapter_factory",
97 "bind_state_to_wrapper",
98 "async_to_sync",
99 "decorator",
100 "lru_cache",
101 "mark_as_async",
102 "mark_as_sync",
103 "sync_to_async",
104 "synchronized",
105 "with_doc",
106 "with_signature",
107 "discover_post_import_hooks",
108 "notify_module_loaded",
109 "register_post_import_hook",
110 "when_imported",
111 "MISSING",
112 "AttributeWrapper",
113 "apply_patch",
114 "find_wrapper",
115 "function_wrapper",
116 "is_wrapped_by",
117 "lazy_import",
118 "patch_function_wrapper",
119 "resolve_owner",
120 "resolve_path",
121 "scoped_function_wrapper",
122 "transient_function_wrapper",
123 "unwrap_object",
124 "unwrapped",
125 "wrap_function_wrapper",
126 "wrap_object",
127 "wrap_object_attribute",
128 "wrapper_chain",
129 "WeakFunctionProxy",
130)