ez-a-sync 0.32.29__cp310-cp310-win_amd64.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.
Potentially problematic release.
This version of ez-a-sync might be problematic. Click here for more details.
- a_sync/ENVIRONMENT_VARIABLES.py +42 -0
- a_sync/__init__.pxd +2 -0
- a_sync/__init__.py +145 -0
- a_sync/_smart.c +22803 -0
- a_sync/_smart.cp310-win_amd64.pyd +0 -0
- a_sync/_smart.pxd +2 -0
- a_sync/_smart.pyi +202 -0
- a_sync/_smart.pyx +674 -0
- a_sync/_typing.py +258 -0
- a_sync/a_sync/__init__.py +60 -0
- a_sync/a_sync/_descriptor.c +20528 -0
- a_sync/a_sync/_descriptor.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_descriptor.pyi +33 -0
- a_sync/a_sync/_descriptor.pyx +422 -0
- a_sync/a_sync/_flags.c +6074 -0
- a_sync/a_sync/_flags.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_flags.pxd +3 -0
- a_sync/a_sync/_flags.pyx +92 -0
- a_sync/a_sync/_helpers.c +14521 -0
- a_sync/a_sync/_helpers.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_helpers.pxd +3 -0
- a_sync/a_sync/_helpers.pyi +10 -0
- a_sync/a_sync/_helpers.pyx +167 -0
- a_sync/a_sync/_kwargs.c +12194 -0
- a_sync/a_sync/_kwargs.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_kwargs.pxd +2 -0
- a_sync/a_sync/_kwargs.pyx +64 -0
- a_sync/a_sync/_meta.py +210 -0
- a_sync/a_sync/abstract.c +12411 -0
- a_sync/a_sync/abstract.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/abstract.pyi +141 -0
- a_sync/a_sync/abstract.pyx +221 -0
- a_sync/a_sync/base.c +14932 -0
- a_sync/a_sync/base.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/base.pyi +60 -0
- a_sync/a_sync/base.pyx +271 -0
- a_sync/a_sync/config.py +168 -0
- a_sync/a_sync/decorator.py +651 -0
- a_sync/a_sync/flags.c +5272 -0
- a_sync/a_sync/flags.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/flags.pxd +72 -0
- a_sync/a_sync/flags.pyi +74 -0
- a_sync/a_sync/flags.pyx +72 -0
- a_sync/a_sync/function.c +37846 -0
- a_sync/a_sync/function.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/function.pxd +28 -0
- a_sync/a_sync/function.pyi +571 -0
- a_sync/a_sync/function.pyx +1381 -0
- a_sync/a_sync/method.c +29774 -0
- a_sync/a_sync/method.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/method.pxd +9 -0
- a_sync/a_sync/method.pyi +525 -0
- a_sync/a_sync/method.pyx +1023 -0
- a_sync/a_sync/modifiers/__init__.pxd +1 -0
- a_sync/a_sync/modifiers/__init__.py +101 -0
- a_sync/a_sync/modifiers/cache/__init__.py +160 -0
- a_sync/a_sync/modifiers/cache/memory.py +165 -0
- a_sync/a_sync/modifiers/limiter.py +132 -0
- a_sync/a_sync/modifiers/manager.c +16149 -0
- a_sync/a_sync/modifiers/manager.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/modifiers/manager.pxd +5 -0
- a_sync/a_sync/modifiers/manager.pyi +219 -0
- a_sync/a_sync/modifiers/manager.pyx +299 -0
- a_sync/a_sync/modifiers/semaphores.py +173 -0
- a_sync/a_sync/property.c +27260 -0
- a_sync/a_sync/property.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/property.pyi +376 -0
- a_sync/a_sync/property.pyx +819 -0
- a_sync/a_sync/singleton.py +63 -0
- a_sync/aliases.py +3 -0
- a_sync/async_property/__init__.pxd +1 -0
- a_sync/async_property/__init__.py +1 -0
- a_sync/async_property/cached.c +20386 -0
- a_sync/async_property/cached.cp310-win_amd64.pyd +0 -0
- a_sync/async_property/cached.pxd +10 -0
- a_sync/async_property/cached.pyi +45 -0
- a_sync/async_property/cached.pyx +178 -0
- a_sync/async_property/proxy.c +34654 -0
- a_sync/async_property/proxy.cp310-win_amd64.pyd +0 -0
- a_sync/async_property/proxy.pxd +2 -0
- a_sync/async_property/proxy.pyi +124 -0
- a_sync/async_property/proxy.pyx +474 -0
- a_sync/asyncio/__init__.pxd +6 -0
- a_sync/asyncio/__init__.py +164 -0
- a_sync/asyncio/as_completed.c +18841 -0
- a_sync/asyncio/as_completed.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/as_completed.pxd +8 -0
- a_sync/asyncio/as_completed.pyi +109 -0
- a_sync/asyncio/as_completed.pyx +269 -0
- a_sync/asyncio/create_task.c +15902 -0
- a_sync/asyncio/create_task.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/create_task.pxd +2 -0
- a_sync/asyncio/create_task.pyi +51 -0
- a_sync/asyncio/create_task.pyx +271 -0
- a_sync/asyncio/gather.c +16679 -0
- a_sync/asyncio/gather.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/gather.pyi +107 -0
- a_sync/asyncio/gather.pyx +218 -0
- a_sync/asyncio/igather.c +12676 -0
- a_sync/asyncio/igather.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/igather.pxd +1 -0
- a_sync/asyncio/igather.pyi +7 -0
- a_sync/asyncio/igather.pyx +182 -0
- a_sync/asyncio/sleep.c +9593 -0
- a_sync/asyncio/sleep.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/sleep.pyi +14 -0
- a_sync/asyncio/sleep.pyx +49 -0
- a_sync/debugging.c +15362 -0
- a_sync/debugging.cp310-win_amd64.pyd +0 -0
- a_sync/debugging.pyi +76 -0
- a_sync/debugging.pyx +107 -0
- a_sync/exceptions.c +13312 -0
- a_sync/exceptions.cp310-win_amd64.pyd +0 -0
- a_sync/exceptions.pyi +376 -0
- a_sync/exceptions.pyx +446 -0
- a_sync/executor.py +619 -0
- a_sync/functools.c +12738 -0
- a_sync/functools.cp310-win_amd64.pyd +0 -0
- a_sync/functools.pxd +7 -0
- a_sync/functools.pyi +33 -0
- a_sync/functools.pyx +139 -0
- a_sync/future.py +1497 -0
- a_sync/iter.c +37271 -0
- a_sync/iter.cp310-win_amd64.pyd +0 -0
- a_sync/iter.pxd +11 -0
- a_sync/iter.pyi +370 -0
- a_sync/iter.pyx +981 -0
- a_sync/primitives/__init__.pxd +1 -0
- a_sync/primitives/__init__.py +53 -0
- a_sync/primitives/_debug.c +15757 -0
- a_sync/primitives/_debug.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/_debug.pxd +12 -0
- a_sync/primitives/_debug.pyi +52 -0
- a_sync/primitives/_debug.pyx +223 -0
- a_sync/primitives/_loggable.c +11529 -0
- a_sync/primitives/_loggable.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/_loggable.pxd +4 -0
- a_sync/primitives/_loggable.pyi +66 -0
- a_sync/primitives/_loggable.pyx +102 -0
- a_sync/primitives/locks/__init__.pxd +8 -0
- a_sync/primitives/locks/__init__.py +17 -0
- a_sync/primitives/locks/counter.c +17679 -0
- a_sync/primitives/locks/counter.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/counter.pxd +12 -0
- a_sync/primitives/locks/counter.pyi +151 -0
- a_sync/primitives/locks/counter.pyx +260 -0
- a_sync/primitives/locks/event.c +17063 -0
- a_sync/primitives/locks/event.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/event.pxd +22 -0
- a_sync/primitives/locks/event.pyi +43 -0
- a_sync/primitives/locks/event.pyx +185 -0
- a_sync/primitives/locks/prio_semaphore.c +25590 -0
- a_sync/primitives/locks/prio_semaphore.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/prio_semaphore.pxd +25 -0
- a_sync/primitives/locks/prio_semaphore.pyi +217 -0
- a_sync/primitives/locks/prio_semaphore.pyx +597 -0
- a_sync/primitives/locks/semaphore.c +26509 -0
- a_sync/primitives/locks/semaphore.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/semaphore.pxd +21 -0
- a_sync/primitives/locks/semaphore.pyi +197 -0
- a_sync/primitives/locks/semaphore.pyx +454 -0
- a_sync/primitives/queue.py +1022 -0
- a_sync/py.typed +0 -0
- a_sync/sphinx/__init__.py +3 -0
- a_sync/sphinx/ext.py +289 -0
- a_sync/task.py +932 -0
- a_sync/utils/__init__.py +105 -0
- a_sync/utils/iterators.py +297 -0
- a_sync/utils/repr.c +15799 -0
- a_sync/utils/repr.cp310-win_amd64.pyd +0 -0
- a_sync/utils/repr.pyi +2 -0
- a_sync/utils/repr.pyx +73 -0
- ez_a_sync-0.32.29.dist-info/METADATA +367 -0
- ez_a_sync-0.32.29.dist-info/RECORD +177 -0
- ez_a_sync-0.32.29.dist-info/WHEEL +5 -0
- ez_a_sync-0.32.29.dist-info/licenses/LICENSE.txt +17 -0
- ez_a_sync-0.32.29.dist-info/top_level.txt +1 -0
|
Binary file
|
a_sync/functools.pxd
ADDED
a_sync/functools.pyi
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from _typeshed import Incomplete as Incomplete
|
|
2
|
+
from typing import Callable, Generic, Optional, Type, TypeVar
|
|
3
|
+
|
|
4
|
+
I = TypeVar("I")
|
|
5
|
+
T = TypeVar("T")
|
|
6
|
+
|
|
7
|
+
class cached_property_unsafe(Generic[I, T]):
|
|
8
|
+
"""A non-threadsafe implementation of functools.cached_property, intended for use in asyncio applications"""
|
|
9
|
+
|
|
10
|
+
func: Callable[[I], T]
|
|
11
|
+
attrname: str
|
|
12
|
+
__doc__: Optional[str]
|
|
13
|
+
def __init__(self, func: Callable[[I], T]) -> None: ...
|
|
14
|
+
def __set_name__(self, owner: Type[I], name: str) -> None: ...
|
|
15
|
+
def __get__(self, instance: I, owner: Optional[Type[I]] = None) -> T: ...
|
|
16
|
+
__class_getitem__: Incomplete
|
|
17
|
+
|
|
18
|
+
def update_wrapper(wrapper: Callable, wrapped: Callable) -> None:
|
|
19
|
+
"""Update a wrapper function to look like the wrapped function
|
|
20
|
+
|
|
21
|
+
wrapper is the function to be updated
|
|
22
|
+
wrapped is the original function
|
|
23
|
+
assigned is a tuple naming the attributes assigned directly
|
|
24
|
+
from the wrapped function to the wrapper function (defaults to
|
|
25
|
+
functools.WRAPPER_ASSIGNMENTS)
|
|
26
|
+
updated is a tuple naming the attributes of the wrapper that
|
|
27
|
+
are updated with the corresponding attribute from the wrapped
|
|
28
|
+
function (defaults to functools.WRAPPER_UPDATES)
|
|
29
|
+
|
|
30
|
+
`assigned` and `updated` args from the functools implementation have
|
|
31
|
+
been disabled for faster tight loops. Use the implementation in the
|
|
32
|
+
`functools` builtin module if you need to use their functionality.
|
|
33
|
+
"""
|
a_sync/functools.pyx
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
cdef object _NOT_FOUND = object()
|
|
5
|
+
|
|
6
|
+
cdef class cached_property_unsafe:
|
|
7
|
+
"""A non-threadsafe implementation of functools.cached_property, intended for use in asyncio applications"""
|
|
8
|
+
|
|
9
|
+
def __cinit__(self, object func):
|
|
10
|
+
self.func = func
|
|
11
|
+
self.attrname = None
|
|
12
|
+
self._doc = func.__doc__
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def __doc__(self) -> Optional[str]:
|
|
16
|
+
return self._doc
|
|
17
|
+
|
|
18
|
+
def __set_name__(self, owner, str name):
|
|
19
|
+
cdef str existing_name = self.attrname
|
|
20
|
+
if existing_name is None:
|
|
21
|
+
self.attrname = name
|
|
22
|
+
elif name != existing_name:
|
|
23
|
+
raise TypeError(
|
|
24
|
+
"Cannot assign the same cached_property to two different names "
|
|
25
|
+
f"({existing_name!r} and {name!r})."
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def __get__(self, instance, owner):
|
|
29
|
+
cdef str attrname
|
|
30
|
+
cdef dict cache
|
|
31
|
+
if instance is None:
|
|
32
|
+
return self
|
|
33
|
+
attrname = self.attrname
|
|
34
|
+
if attrname is None:
|
|
35
|
+
raise TypeError(
|
|
36
|
+
"Cannot use cached_property instance without calling __set_name__ on it.")
|
|
37
|
+
try:
|
|
38
|
+
cache = instance.__dict__
|
|
39
|
+
except AttributeError: # not all objects have __dict__ (e.g. class defines slots)
|
|
40
|
+
msg = (
|
|
41
|
+
f"No '__dict__' attribute on {type(instance).__name__!r} "
|
|
42
|
+
f"instance to cache {attrname!r} property."
|
|
43
|
+
)
|
|
44
|
+
raise TypeError(msg) from None
|
|
45
|
+
val = cache.get(attrname, _NOT_FOUND)
|
|
46
|
+
if val is _NOT_FOUND:
|
|
47
|
+
val = self.func(instance)
|
|
48
|
+
try:
|
|
49
|
+
cache[attrname] = val
|
|
50
|
+
except TypeError:
|
|
51
|
+
msg = (
|
|
52
|
+
f"The '__dict__' attribute on {type(instance).__name__!r} instance "
|
|
53
|
+
f"does not support item assignment for caching {attrname!r} property."
|
|
54
|
+
)
|
|
55
|
+
raise TypeError(msg) from None
|
|
56
|
+
return val
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
################################################################################
|
|
60
|
+
### update_wrapper() and wraps() decorator
|
|
61
|
+
################################################################################
|
|
62
|
+
|
|
63
|
+
# update_wrapper() and wraps() are tools to help write
|
|
64
|
+
# wrapper functions that can handle naive introspection
|
|
65
|
+
|
|
66
|
+
cpdef update_wrapper(wrapper, wrapped):
|
|
67
|
+
"""Update a wrapper function to look like the wrapped function
|
|
68
|
+
|
|
69
|
+
wrapper is the function to be updated
|
|
70
|
+
wrapped is the original function
|
|
71
|
+
assigned is a tuple naming the attributes assigned directly
|
|
72
|
+
from the wrapped function to the wrapper function (defaults to
|
|
73
|
+
functools.WRAPPER_ASSIGNMENTS)
|
|
74
|
+
updated is a tuple naming the attributes of the wrapper that
|
|
75
|
+
are updated with the corresponding attribute from the wrapped
|
|
76
|
+
function (defaults to functools.WRAPPER_UPDATES)
|
|
77
|
+
|
|
78
|
+
`assigned` and `updated` args from the functools implementation have
|
|
79
|
+
been disabled for faster tight loops. Use the implementation in the
|
|
80
|
+
`functools` builtin module if you need to use their functionality.
|
|
81
|
+
"""
|
|
82
|
+
try:
|
|
83
|
+
value = getattr(wrapped, '__module__')
|
|
84
|
+
except AttributeError:
|
|
85
|
+
pass
|
|
86
|
+
else:
|
|
87
|
+
setattr(wrapper, '__module__', value)
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
value = getattr(wrapped, '__name__')
|
|
91
|
+
except AttributeError:
|
|
92
|
+
pass
|
|
93
|
+
else:
|
|
94
|
+
setattr(wrapper, '__name__', value)
|
|
95
|
+
|
|
96
|
+
try:
|
|
97
|
+
value = getattr(wrapped, '__qualname__')
|
|
98
|
+
except AttributeError:
|
|
99
|
+
pass
|
|
100
|
+
else:
|
|
101
|
+
setattr(wrapper, '__qualname__', value)
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
value = getattr(wrapped, '__doc__')
|
|
105
|
+
except AttributeError:
|
|
106
|
+
pass
|
|
107
|
+
else:
|
|
108
|
+
setattr(wrapper, '__doc__', value)
|
|
109
|
+
|
|
110
|
+
try:
|
|
111
|
+
value = getattr(wrapped, '__annotations__')
|
|
112
|
+
except AttributeError:
|
|
113
|
+
pass
|
|
114
|
+
else:
|
|
115
|
+
setattr(wrapper, '__annotations__', value)
|
|
116
|
+
|
|
117
|
+
getattr(wrapper, '__dict__').update(getattr(wrapped, '__dict__', {}))
|
|
118
|
+
# Issue #17482: set __wrapped__ last so we don't inadvertently copy it
|
|
119
|
+
# from the wrapped function when updating __dict__
|
|
120
|
+
wrapper.__wrapped__ = wrapped
|
|
121
|
+
# Return the wrapper so this can be used as a decorator via partial()
|
|
122
|
+
return wrapper
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
cdef wraps(wrapped):
|
|
126
|
+
"""Decorator factory to apply update_wrapper() to a wrapper function
|
|
127
|
+
|
|
128
|
+
Returns a decorator that invokes update_wrapper() with the decorated
|
|
129
|
+
function as the wrapper argument and the arguments to wraps() as the
|
|
130
|
+
remaining arguments. Default arguments are as for update_wrapper().
|
|
131
|
+
This is a convenience function to simplify applying partial() to
|
|
132
|
+
update_wrapper().
|
|
133
|
+
|
|
134
|
+
`assigned` and `updated` args from the functools implementation have
|
|
135
|
+
been disabled for faster tight loops. Use the implementation in the
|
|
136
|
+
`functools` builtin module if you need to use their functionality.
|
|
137
|
+
|
|
138
|
+
"""
|
|
139
|
+
return lambda wrapper: update_wrapper(wrapper, wrapped)
|