ez-a-sync 0.32.12__cp313-cp313-musllinux_1_2_i686.whl → 0.32.14__cp313-cp313-musllinux_1_2_i686.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/_smart.c +923 -557
- a_sync/_smart.cpython-313-i386-linux-musl.so +0 -0
- a_sync/_smart.pyx +17 -1
- a_sync/debugging.c +3 -2
- a_sync/debugging.cpython-313-i386-linux-musl.so +0 -0
- a_sync/iter.c +216 -81
- a_sync/iter.cpython-313-i386-linux-musl.so +0 -0
- a_sync/iter.pxd +2 -0
- a_sync/task.py +22 -6
- {ez_a_sync-0.32.12.dist-info → ez_a_sync-0.32.14.dist-info}/METADATA +1 -1
- {ez_a_sync-0.32.12.dist-info → ez_a_sync-0.32.14.dist-info}/RECORD +14 -14
- {ez_a_sync-0.32.12.dist-info → ez_a_sync-0.32.14.dist-info}/WHEEL +1 -1
- {ez_a_sync-0.32.12.dist-info → ez_a_sync-0.32.14.dist-info}/licenses/LICENSE.txt +0 -0
- {ez_a_sync-0.32.12.dist-info → ez_a_sync-0.32.14.dist-info}/top_level.txt +0 -0
|
Binary file
|
a_sync/_smart.pyx
CHANGED
|
@@ -34,12 +34,12 @@ cdef object get_event_loop = asyncio.get_event_loop
|
|
|
34
34
|
cdef object AbstractEventLoop = asyncio.AbstractEventLoop
|
|
35
35
|
cdef object Future = asyncio.Future
|
|
36
36
|
cdef object Task = asyncio.Task
|
|
37
|
+
cdef object CancelledError = asyncio.CancelledError
|
|
37
38
|
cdef object InvalidStateError = asyncio.InvalidStateError
|
|
38
39
|
cdef dict[object, object] _current_tasks = asyncio.tasks._current_tasks
|
|
39
40
|
cdef object _future_init = asyncio.Future.__init__
|
|
40
41
|
cdef object _get_loop = asyncio.futures._get_loop
|
|
41
42
|
cdef object _task_init = asyncio.Task.__init__
|
|
42
|
-
del asyncio
|
|
43
43
|
|
|
44
44
|
# cdef logging
|
|
45
45
|
cdef public object logger = getLogger(__name__)
|
|
@@ -510,6 +510,22 @@ class SmartTask(Task, Generic[T]):
|
|
|
510
510
|
if _is_not_done(self):
|
|
511
511
|
(<set>self._waiters).remove(waiter)
|
|
512
512
|
|
|
513
|
+
def _make_cancelled_error(self) -> asyncio.CancelledError:
|
|
514
|
+
# this function is not present in python3.8 so we're backporting it
|
|
515
|
+
"""Create the CancelledError to raise if the Future is cancelled.
|
|
516
|
+
|
|
517
|
+
This should only be called once when handling a cancellation since
|
|
518
|
+
it erases the saved context exception value.
|
|
519
|
+
"""
|
|
520
|
+
if self._cancel_message is None:
|
|
521
|
+
exc = CancelledError()
|
|
522
|
+
else:
|
|
523
|
+
exc = CancelledError(self._cancel_message)
|
|
524
|
+
exc.__context__ = self._cancelled_exc
|
|
525
|
+
# Remove the reference since we don't need this anymore.
|
|
526
|
+
self._cancelled_exc = None
|
|
527
|
+
return exc
|
|
528
|
+
|
|
513
529
|
|
|
514
530
|
cdef object _SmartTask = SmartTask
|
|
515
531
|
|
a_sync/debugging.c
CHANGED
|
@@ -1517,12 +1517,13 @@ struct __pyx_defaults {
|
|
|
1517
1517
|
*
|
|
1518
1518
|
* cdef class _ASyncGeneratorFunction: # <<<<<<<<<<<<<<
|
|
1519
1519
|
* cdef readonly object _cache_handle
|
|
1520
|
-
*
|
|
1520
|
+
* # must be public for functools.wraps
|
|
1521
1521
|
*/
|
|
1522
1522
|
struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction {
|
|
1523
1523
|
PyObject_HEAD
|
|
1524
1524
|
struct __pyx_vtabstruct_6a_sync_4iter__ASyncGeneratorFunction *__pyx_vtab;
|
|
1525
1525
|
PyObject *_cache_handle;
|
|
1526
|
+
PyObject *__wrapped__;
|
|
1526
1527
|
PyObject *__weakself__;
|
|
1527
1528
|
PyObject *_ASyncGeneratorFunction__weakself_ptr;
|
|
1528
1529
|
};
|
|
@@ -1609,7 +1610,7 @@ struct __pyx_obj_6a_sync_9debugging___pyx_scope_struct_3__stuck_debug_task {
|
|
|
1609
1610
|
*
|
|
1610
1611
|
* cdef class _ASyncGeneratorFunction: # <<<<<<<<<<<<<<
|
|
1611
1612
|
* cdef readonly object _cache_handle
|
|
1612
|
-
*
|
|
1613
|
+
* # must be public for functools.wraps
|
|
1613
1614
|
*/
|
|
1614
1615
|
|
|
1615
1616
|
struct __pyx_vtabstruct_6a_sync_4iter__ASyncGeneratorFunction {
|
|
Binary file
|
a_sync/iter.c
CHANGED
|
@@ -1603,12 +1603,13 @@ struct __pyx_obj_6a_sync_9functools_cached_property_unsafe {
|
|
|
1603
1603
|
*
|
|
1604
1604
|
* cdef class _ASyncGeneratorFunction: # <<<<<<<<<<<<<<
|
|
1605
1605
|
* cdef readonly object _cache_handle
|
|
1606
|
-
*
|
|
1606
|
+
* # must be public for functools.wraps
|
|
1607
1607
|
*/
|
|
1608
1608
|
struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction {
|
|
1609
1609
|
PyObject_HEAD
|
|
1610
1610
|
struct __pyx_vtabstruct_6a_sync_4iter__ASyncGeneratorFunction *__pyx_vtab;
|
|
1611
1611
|
PyObject *_cache_handle;
|
|
1612
|
+
PyObject *__wrapped__;
|
|
1612
1613
|
PyObject *__weakself__;
|
|
1613
1614
|
PyObject *_ASyncGeneratorFunction__weakself_ptr;
|
|
1614
1615
|
};
|
|
@@ -3705,6 +3706,9 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
3705
3706
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_6__get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */
|
|
3706
3707
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_8__self_____get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3707
3708
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_13_cache_handle___get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3709
|
+
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped_____get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3710
|
+
static int __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___2__set__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
|
|
3711
|
+
static int __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___4__del__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3708
3712
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_12__weakself_____get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3709
3713
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self); /* proto */
|
|
3710
3714
|
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
|
|
@@ -11498,7 +11502,11 @@ static int __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction___init__(struct __py
|
|
|
11498
11502
|
*
|
|
11499
11503
|
*/
|
|
11500
11504
|
__Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
|
|
11501
|
-
|
|
11505
|
+
__Pyx_INCREF(__pyx_v_async_gen_func);
|
|
11506
|
+
__Pyx_GIVEREF(__pyx_v_async_gen_func);
|
|
11507
|
+
__Pyx_GOTREF(__pyx_v_self->__wrapped__);
|
|
11508
|
+
__Pyx_DECREF(__pyx_v_self->__wrapped__);
|
|
11509
|
+
__pyx_v_self->__wrapped__ = __pyx_v_async_gen_func;
|
|
11502
11510
|
|
|
11503
11511
|
/* "a_sync/iter.pyx":482
|
|
11504
11512
|
* "The actual async generator function."
|
|
@@ -11696,8 +11704,7 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_2__repr__(stru
|
|
|
11696
11704
|
PyObject *__pyx_t_3 = NULL;
|
|
11697
11705
|
PyObject *__pyx_t_4 = NULL;
|
|
11698
11706
|
PyObject *__pyx_t_5 = NULL;
|
|
11699
|
-
|
|
11700
|
-
unsigned int __pyx_t_7;
|
|
11707
|
+
unsigned int __pyx_t_6;
|
|
11701
11708
|
int __pyx_lineno = 0;
|
|
11702
11709
|
const char *__pyx_filename = NULL;
|
|
11703
11710
|
int __pyx_clineno = 0;
|
|
@@ -11727,17 +11734,6 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_2__repr__(stru
|
|
|
11727
11734
|
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
|
|
11728
11735
|
__Pyx_GOTREF(__pyx_t_3);
|
|
11729
11736
|
|
|
11730
|
-
/* "a_sync/iter.pyx":495
|
|
11731
|
-
* return "<{} for {} at {}>".format(
|
|
11732
|
-
* type(self).__name__,
|
|
11733
|
-
* self.__wrapped__, # <<<<<<<<<<<<<<
|
|
11734
|
-
* hex(id(self))
|
|
11735
|
-
* )
|
|
11736
|
-
*/
|
|
11737
|
-
__Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
|
|
11738
|
-
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wrapped_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
|
|
11739
|
-
__Pyx_GOTREF(__pyx_t_4);
|
|
11740
|
-
|
|
11741
11737
|
/* "a_sync/iter.pyx":496
|
|
11742
11738
|
* type(self).__name__,
|
|
11743
11739
|
* self.__wrapped__,
|
|
@@ -11746,32 +11742,31 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_2__repr__(stru
|
|
|
11746
11742
|
*
|
|
11747
11743
|
*/
|
|
11748
11744
|
__Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
|
|
11749
|
-
|
|
11745
|
+
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
|
|
11746
|
+
__Pyx_GOTREF(__pyx_t_4);
|
|
11747
|
+
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
|
|
11750
11748
|
__Pyx_GOTREF(__pyx_t_5);
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
__pyx_t_5 = NULL;
|
|
11755
|
-
__pyx_t_7 = 0;
|
|
11749
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11750
|
+
__pyx_t_4 = NULL;
|
|
11751
|
+
__pyx_t_6 = 0;
|
|
11756
11752
|
#if CYTHON_UNPACK_METHODS
|
|
11757
11753
|
if (likely(PyMethod_Check(__pyx_t_2))) {
|
|
11758
|
-
|
|
11759
|
-
if (likely(
|
|
11754
|
+
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
|
|
11755
|
+
if (likely(__pyx_t_4)) {
|
|
11760
11756
|
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
|
|
11761
|
-
__Pyx_INCREF(
|
|
11757
|
+
__Pyx_INCREF(__pyx_t_4);
|
|
11762
11758
|
__Pyx_INCREF(function);
|
|
11763
11759
|
__Pyx_DECREF_SET(__pyx_t_2, function);
|
|
11764
|
-
|
|
11760
|
+
__pyx_t_6 = 1;
|
|
11765
11761
|
}
|
|
11766
11762
|
}
|
|
11767
11763
|
#endif
|
|
11768
11764
|
{
|
|
11769
|
-
PyObject *__pyx_callargs[4] = {
|
|
11770
|
-
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-
|
|
11771
|
-
__Pyx_XDECREF(
|
|
11765
|
+
PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->__wrapped__, __pyx_t_5};
|
|
11766
|
+
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
|
|
11767
|
+
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11772
11768
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
11773
|
-
__Pyx_DECREF(
|
|
11774
|
-
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
11769
|
+
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
11775
11770
|
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
|
|
11776
11771
|
__Pyx_GOTREF(__pyx_t_1);
|
|
11777
11772
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
@@ -11795,7 +11790,6 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_2__repr__(stru
|
|
|
11795
11790
|
__Pyx_XDECREF(__pyx_t_3);
|
|
11796
11791
|
__Pyx_XDECREF(__pyx_t_4);
|
|
11797
11792
|
__Pyx_XDECREF(__pyx_t_5);
|
|
11798
|
-
__Pyx_XDECREF(__pyx_t_6);
|
|
11799
11793
|
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
11800
11794
|
__pyx_r = NULL;
|
|
11801
11795
|
__pyx_L0:;
|
|
@@ -11863,9 +11857,8 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
11863
11857
|
PyObject *__pyx_t_3 = NULL;
|
|
11864
11858
|
PyObject *__pyx_t_4 = NULL;
|
|
11865
11859
|
PyObject *__pyx_t_5 = NULL;
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
PyObject *__pyx_t_8 = NULL;
|
|
11860
|
+
unsigned int __pyx_t_6;
|
|
11861
|
+
PyObject *__pyx_t_7 = NULL;
|
|
11869
11862
|
int __pyx_lineno = 0;
|
|
11870
11863
|
const char *__pyx_filename = NULL;
|
|
11871
11864
|
int __pyx_clineno = 0;
|
|
@@ -11894,33 +11887,30 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
11894
11887
|
__Pyx_XDECREF(__pyx_r);
|
|
11895
11888
|
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASyncIterator); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
|
|
11896
11889
|
__Pyx_GOTREF(__pyx_t_3);
|
|
11897
|
-
__pyx_t_4 =
|
|
11890
|
+
__pyx_t_4 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
|
|
11898
11891
|
__Pyx_GOTREF(__pyx_t_4);
|
|
11899
|
-
__pyx_t_5 =
|
|
11892
|
+
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->__wrapped__, __pyx_v_args, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
|
|
11900
11893
|
__Pyx_GOTREF(__pyx_t_5);
|
|
11901
|
-
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_args, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
|
|
11902
|
-
__Pyx_GOTREF(__pyx_t_6);
|
|
11903
11894
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
__pyx_t_7 = 0;
|
|
11895
|
+
__pyx_t_4 = NULL;
|
|
11896
|
+
__pyx_t_6 = 0;
|
|
11907
11897
|
#if CYTHON_UNPACK_METHODS
|
|
11908
11898
|
if (unlikely(PyMethod_Check(__pyx_t_3))) {
|
|
11909
|
-
|
|
11910
|
-
if (likely(
|
|
11899
|
+
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
|
|
11900
|
+
if (likely(__pyx_t_4)) {
|
|
11911
11901
|
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
|
|
11912
|
-
__Pyx_INCREF(
|
|
11902
|
+
__Pyx_INCREF(__pyx_t_4);
|
|
11913
11903
|
__Pyx_INCREF(function);
|
|
11914
11904
|
__Pyx_DECREF_SET(__pyx_t_3, function);
|
|
11915
|
-
|
|
11905
|
+
__pyx_t_6 = 1;
|
|
11916
11906
|
}
|
|
11917
11907
|
}
|
|
11918
11908
|
#endif
|
|
11919
11909
|
{
|
|
11920
|
-
PyObject *__pyx_callargs[2] = {
|
|
11921
|
-
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-
|
|
11922
|
-
__Pyx_XDECREF(
|
|
11923
|
-
__Pyx_DECREF(
|
|
11910
|
+
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
|
|
11911
|
+
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
|
|
11912
|
+
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11913
|
+
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
11924
11914
|
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
|
|
11925
11915
|
__Pyx_GOTREF(__pyx_t_2);
|
|
11926
11916
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
@@ -11949,8 +11939,6 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
11949
11939
|
__Pyx_XDECREF(__pyx_r);
|
|
11950
11940
|
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ASyncIterator); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11951
11941
|
__Pyx_GOTREF(__pyx_t_3);
|
|
11952
|
-
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wrapped_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11953
|
-
__Pyx_GOTREF(__pyx_t_6);
|
|
11954
11942
|
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_self_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11955
11943
|
__Pyx_GOTREF(__pyx_t_5);
|
|
11956
11944
|
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
@@ -11963,13 +11951,12 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
11963
11951
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11964
11952
|
__pyx_t_4 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11965
11953
|
__Pyx_GOTREF(__pyx_t_4);
|
|
11966
|
-
|
|
11967
|
-
__Pyx_GOTREF(
|
|
11968
|
-
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
11954
|
+
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_self->__wrapped__, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11955
|
+
__Pyx_GOTREF(__pyx_t_7);
|
|
11969
11956
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
11970
11957
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11971
11958
|
__pyx_t_4 = NULL;
|
|
11972
|
-
|
|
11959
|
+
__pyx_t_6 = 0;
|
|
11973
11960
|
#if CYTHON_UNPACK_METHODS
|
|
11974
11961
|
if (unlikely(PyMethod_Check(__pyx_t_3))) {
|
|
11975
11962
|
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
|
|
@@ -11978,15 +11965,15 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
11978
11965
|
__Pyx_INCREF(__pyx_t_4);
|
|
11979
11966
|
__Pyx_INCREF(function);
|
|
11980
11967
|
__Pyx_DECREF_SET(__pyx_t_3, function);
|
|
11981
|
-
|
|
11968
|
+
__pyx_t_6 = 1;
|
|
11982
11969
|
}
|
|
11983
11970
|
}
|
|
11984
11971
|
#endif
|
|
11985
11972
|
{
|
|
11986
|
-
PyObject *__pyx_callargs[2] = {__pyx_t_4,
|
|
11987
|
-
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-
|
|
11973
|
+
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
|
|
11974
|
+
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
|
|
11988
11975
|
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
11989
|
-
__Pyx_DECREF(
|
|
11976
|
+
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
11990
11977
|
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
|
|
11991
11978
|
__Pyx_GOTREF(__pyx_t_2);
|
|
11992
11979
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
@@ -12009,8 +11996,7 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_4__call__(stru
|
|
|
12009
11996
|
__Pyx_XDECREF(__pyx_t_3);
|
|
12010
11997
|
__Pyx_XDECREF(__pyx_t_4);
|
|
12011
11998
|
__Pyx_XDECREF(__pyx_t_5);
|
|
12012
|
-
__Pyx_XDECREF(
|
|
12013
|
-
__Pyx_XDECREF(__pyx_t_8);
|
|
11999
|
+
__Pyx_XDECREF(__pyx_t_7);
|
|
12014
12000
|
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
12015
12001
|
__pyx_r = NULL;
|
|
12016
12002
|
__pyx_L0:;
|
|
@@ -12064,8 +12050,7 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_6__get__(struc
|
|
|
12064
12050
|
PyObject *__pyx_t_9 = NULL;
|
|
12065
12051
|
PyObject *__pyx_t_10 = NULL;
|
|
12066
12052
|
PyObject *__pyx_t_11 = NULL;
|
|
12067
|
-
|
|
12068
|
-
unsigned int __pyx_t_13;
|
|
12053
|
+
unsigned int __pyx_t_12;
|
|
12069
12054
|
int __pyx_lineno = 0;
|
|
12070
12055
|
const char *__pyx_filename = NULL;
|
|
12071
12056
|
int __pyx_clineno = 0;
|
|
@@ -12199,27 +12184,24 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_6__get__(struc
|
|
|
12199
12184
|
__Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L6_except_error))
|
|
12200
12185
|
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ASyncGeneratorFunction); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 523, __pyx_L6_except_error)
|
|
12201
12186
|
__Pyx_GOTREF(__pyx_t_10);
|
|
12202
|
-
__pyx_t_11 =
|
|
12203
|
-
|
|
12204
|
-
__pyx_t_12 = NULL;
|
|
12205
|
-
__pyx_t_13 = 0;
|
|
12187
|
+
__pyx_t_11 = NULL;
|
|
12188
|
+
__pyx_t_12 = 0;
|
|
12206
12189
|
#if CYTHON_UNPACK_METHODS
|
|
12207
12190
|
if (unlikely(PyMethod_Check(__pyx_t_10))) {
|
|
12208
|
-
|
|
12209
|
-
if (likely(
|
|
12191
|
+
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
|
|
12192
|
+
if (likely(__pyx_t_11)) {
|
|
12210
12193
|
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
|
|
12211
|
-
__Pyx_INCREF(
|
|
12194
|
+
__Pyx_INCREF(__pyx_t_11);
|
|
12212
12195
|
__Pyx_INCREF(function);
|
|
12213
12196
|
__Pyx_DECREF_SET(__pyx_t_10, function);
|
|
12214
|
-
|
|
12197
|
+
__pyx_t_12 = 1;
|
|
12215
12198
|
}
|
|
12216
12199
|
}
|
|
12217
12200
|
#endif
|
|
12218
12201
|
{
|
|
12219
|
-
PyObject *__pyx_callargs[3] = {
|
|
12220
|
-
__pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-
|
|
12221
|
-
__Pyx_XDECREF(
|
|
12222
|
-
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
12202
|
+
PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_self->__wrapped__, __pyx_v_instance};
|
|
12203
|
+
__pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12);
|
|
12204
|
+
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
|
|
12223
12205
|
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L6_except_error)
|
|
12224
12206
|
__Pyx_GOTREF(__pyx_t_9);
|
|
12225
12207
|
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
|
|
@@ -12314,7 +12296,6 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_6__get__(struc
|
|
|
12314
12296
|
__Pyx_XDECREF(__pyx_t_9);
|
|
12315
12297
|
__Pyx_XDECREF(__pyx_t_10);
|
|
12316
12298
|
__Pyx_XDECREF(__pyx_t_11);
|
|
12317
|
-
__Pyx_XDECREF(__pyx_t_12);
|
|
12318
12299
|
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
12319
12300
|
__pyx_r = NULL;
|
|
12320
12301
|
__pyx_L0:;
|
|
@@ -12766,8 +12747,8 @@ static void __pyx_f_6a_sync_4iter_23_ASyncGeneratorFunction__ASyncGeneratorFunct
|
|
|
12766
12747
|
*
|
|
12767
12748
|
* cdef class _ASyncGeneratorFunction:
|
|
12768
12749
|
* cdef readonly object _cache_handle # <<<<<<<<<<<<<<
|
|
12769
|
-
*
|
|
12770
|
-
* cdef
|
|
12750
|
+
* # must be public for functools.wraps
|
|
12751
|
+
* cdef public object __wrapped__
|
|
12771
12752
|
*/
|
|
12772
12753
|
|
|
12773
12754
|
/* Python wrapper */
|
|
@@ -12810,9 +12791,141 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_13_cache_handl
|
|
|
12810
12791
|
return __pyx_r;
|
|
12811
12792
|
}
|
|
12812
12793
|
|
|
12813
|
-
/* "a_sync/iter.pxd":
|
|
12814
|
-
* cdef class _ASyncGeneratorFunction:
|
|
12794
|
+
/* "a_sync/iter.pxd":6
|
|
12815
12795
|
* cdef readonly object _cache_handle
|
|
12796
|
+
* # must be public for functools.wraps
|
|
12797
|
+
* cdef public object __wrapped__ # <<<<<<<<<<<<<<
|
|
12798
|
+
* cdef readonly object __weakself__
|
|
12799
|
+
* cdef PyObject *__weakself_ptr
|
|
12800
|
+
*/
|
|
12801
|
+
|
|
12802
|
+
/* Python wrapper */
|
|
12803
|
+
static PyObject *__pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___1__get__(PyObject *__pyx_v_self); /*proto*/
|
|
12804
|
+
static PyObject *__pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___1__get__(PyObject *__pyx_v_self) {
|
|
12805
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
12806
|
+
PyObject *__pyx_r = 0;
|
|
12807
|
+
__Pyx_RefNannyDeclarations
|
|
12808
|
+
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
|
|
12809
|
+
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
|
|
12810
|
+
__pyx_r = __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped_____get__(((struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *)__pyx_v_self));
|
|
12811
|
+
|
|
12812
|
+
/* function exit code */
|
|
12813
|
+
__Pyx_RefNannyFinishContext();
|
|
12814
|
+
return __pyx_r;
|
|
12815
|
+
}
|
|
12816
|
+
|
|
12817
|
+
static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped_____get__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self) {
|
|
12818
|
+
PyObject *__pyx_r = NULL;
|
|
12819
|
+
__Pyx_TraceDeclarations
|
|
12820
|
+
__Pyx_RefNannyDeclarations
|
|
12821
|
+
int __pyx_lineno = 0;
|
|
12822
|
+
const char *__pyx_filename = NULL;
|
|
12823
|
+
int __pyx_clineno = 0;
|
|
12824
|
+
__Pyx_RefNannySetupContext("__get__", 1);
|
|
12825
|
+
__Pyx_TraceCall("__get__", __pyx_f[2], 6, 0, __PYX_ERR(2, 6, __pyx_L1_error));
|
|
12826
|
+
__Pyx_XDECREF(__pyx_r);
|
|
12827
|
+
__Pyx_INCREF(__pyx_v_self->__wrapped__);
|
|
12828
|
+
__pyx_r = __pyx_v_self->__wrapped__;
|
|
12829
|
+
goto __pyx_L0;
|
|
12830
|
+
|
|
12831
|
+
/* function exit code */
|
|
12832
|
+
__pyx_L1_error:;
|
|
12833
|
+
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__wrapped__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
12834
|
+
__pyx_r = NULL;
|
|
12835
|
+
__pyx_L0:;
|
|
12836
|
+
__Pyx_XGIVEREF(__pyx_r);
|
|
12837
|
+
__Pyx_TraceReturn(__pyx_r, 0);
|
|
12838
|
+
__Pyx_RefNannyFinishContext();
|
|
12839
|
+
return __pyx_r;
|
|
12840
|
+
}
|
|
12841
|
+
|
|
12842
|
+
/* Python wrapper */
|
|
12843
|
+
static int __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
|
|
12844
|
+
static int __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
|
|
12845
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
12846
|
+
int __pyx_r;
|
|
12847
|
+
__Pyx_RefNannyDeclarations
|
|
12848
|
+
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
|
|
12849
|
+
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
|
|
12850
|
+
__pyx_r = __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___2__set__(((struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *)__pyx_v_self), ((PyObject *)__pyx_v_value));
|
|
12851
|
+
|
|
12852
|
+
/* function exit code */
|
|
12853
|
+
__Pyx_RefNannyFinishContext();
|
|
12854
|
+
return __pyx_r;
|
|
12855
|
+
}
|
|
12856
|
+
|
|
12857
|
+
static int __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___2__set__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self, PyObject *__pyx_v_value) {
|
|
12858
|
+
int __pyx_r;
|
|
12859
|
+
__Pyx_TraceDeclarations
|
|
12860
|
+
__Pyx_RefNannyDeclarations
|
|
12861
|
+
int __pyx_lineno = 0;
|
|
12862
|
+
const char *__pyx_filename = NULL;
|
|
12863
|
+
int __pyx_clineno = 0;
|
|
12864
|
+
__Pyx_RefNannySetupContext("__set__", 1);
|
|
12865
|
+
__Pyx_TraceCall("__set__", __pyx_f[2], 6, 0, __PYX_ERR(2, 6, __pyx_L1_error));
|
|
12866
|
+
__Pyx_INCREF(__pyx_v_value);
|
|
12867
|
+
__Pyx_GIVEREF(__pyx_v_value);
|
|
12868
|
+
__Pyx_GOTREF(__pyx_v_self->__wrapped__);
|
|
12869
|
+
__Pyx_DECREF(__pyx_v_self->__wrapped__);
|
|
12870
|
+
__pyx_v_self->__wrapped__ = __pyx_v_value;
|
|
12871
|
+
|
|
12872
|
+
/* function exit code */
|
|
12873
|
+
__pyx_r = 0;
|
|
12874
|
+
goto __pyx_L0;
|
|
12875
|
+
__pyx_L1_error:;
|
|
12876
|
+
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__wrapped__.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
12877
|
+
__pyx_r = -1;
|
|
12878
|
+
__pyx_L0:;
|
|
12879
|
+
__Pyx_TraceReturn(Py_None, 0);
|
|
12880
|
+
__Pyx_RefNannyFinishContext();
|
|
12881
|
+
return __pyx_r;
|
|
12882
|
+
}
|
|
12883
|
+
|
|
12884
|
+
/* Python wrapper */
|
|
12885
|
+
static int __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___5__del__(PyObject *__pyx_v_self); /*proto*/
|
|
12886
|
+
static int __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___5__del__(PyObject *__pyx_v_self) {
|
|
12887
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
12888
|
+
int __pyx_r;
|
|
12889
|
+
__Pyx_RefNannyDeclarations
|
|
12890
|
+
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
|
|
12891
|
+
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
|
|
12892
|
+
__pyx_r = __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___4__del__(((struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *)__pyx_v_self));
|
|
12893
|
+
|
|
12894
|
+
/* function exit code */
|
|
12895
|
+
__Pyx_RefNannyFinishContext();
|
|
12896
|
+
return __pyx_r;
|
|
12897
|
+
}
|
|
12898
|
+
|
|
12899
|
+
static int __pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___4__del__(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *__pyx_v_self) {
|
|
12900
|
+
int __pyx_r;
|
|
12901
|
+
__Pyx_TraceDeclarations
|
|
12902
|
+
__Pyx_RefNannyDeclarations
|
|
12903
|
+
int __pyx_lineno = 0;
|
|
12904
|
+
const char *__pyx_filename = NULL;
|
|
12905
|
+
int __pyx_clineno = 0;
|
|
12906
|
+
__Pyx_RefNannySetupContext("__del__", 1);
|
|
12907
|
+
__Pyx_TraceCall("__del__", __pyx_f[2], 6, 0, __PYX_ERR(2, 6, __pyx_L1_error));
|
|
12908
|
+
__Pyx_INCREF(Py_None);
|
|
12909
|
+
__Pyx_GIVEREF(Py_None);
|
|
12910
|
+
__Pyx_GOTREF(__pyx_v_self->__wrapped__);
|
|
12911
|
+
__Pyx_DECREF(__pyx_v_self->__wrapped__);
|
|
12912
|
+
__pyx_v_self->__wrapped__ = Py_None;
|
|
12913
|
+
|
|
12914
|
+
/* function exit code */
|
|
12915
|
+
__pyx_r = 0;
|
|
12916
|
+
goto __pyx_L0;
|
|
12917
|
+
__pyx_L1_error:;
|
|
12918
|
+
__Pyx_AddTraceback("a_sync.iter._ASyncGeneratorFunction.__wrapped__.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
12919
|
+
__pyx_r = -1;
|
|
12920
|
+
__pyx_L0:;
|
|
12921
|
+
__Pyx_TraceReturn(Py_None, 0);
|
|
12922
|
+
__Pyx_RefNannyFinishContext();
|
|
12923
|
+
return __pyx_r;
|
|
12924
|
+
}
|
|
12925
|
+
|
|
12926
|
+
/* "a_sync/iter.pxd":7
|
|
12927
|
+
* # must be public for functools.wraps
|
|
12928
|
+
* cdef public object __wrapped__
|
|
12816
12929
|
* cdef readonly object __weakself__ # <<<<<<<<<<<<<<
|
|
12817
12930
|
* cdef PyObject *__weakself_ptr
|
|
12818
12931
|
* cdef inline void _set_cache_handle(self, object handle)
|
|
@@ -12841,7 +12954,7 @@ static PyObject *__pyx_pf_6a_sync_4iter_23_ASyncGeneratorFunction_12__weakself__
|
|
|
12841
12954
|
const char *__pyx_filename = NULL;
|
|
12842
12955
|
int __pyx_clineno = 0;
|
|
12843
12956
|
__Pyx_RefNannySetupContext("__get__", 1);
|
|
12844
|
-
__Pyx_TraceCall("__get__", __pyx_f[2],
|
|
12957
|
+
__Pyx_TraceCall("__get__", __pyx_f[2], 7, 0, __PYX_ERR(2, 7, __pyx_L1_error));
|
|
12845
12958
|
__Pyx_XDECREF(__pyx_r);
|
|
12846
12959
|
__Pyx_INCREF(__pyx_v_self->__weakself__);
|
|
12847
12960
|
__pyx_r = __pyx_v_self->__weakself__;
|
|
@@ -21572,6 +21685,7 @@ static PyObject *__pyx_tp_new_6a_sync_4iter__ASyncGeneratorFunction(PyTypeObject
|
|
|
21572
21685
|
p = ((struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction *)o);
|
|
21573
21686
|
p->__pyx_vtab = __pyx_vtabptr_6a_sync_4iter__ASyncGeneratorFunction;
|
|
21574
21687
|
p->_cache_handle = Py_None; Py_INCREF(Py_None);
|
|
21688
|
+
p->__wrapped__ = Py_None; Py_INCREF(Py_None);
|
|
21575
21689
|
p->__weakself__ = Py_None; Py_INCREF(Py_None);
|
|
21576
21690
|
return o;
|
|
21577
21691
|
}
|
|
@@ -21587,6 +21701,7 @@ static void __pyx_tp_dealloc_6a_sync_4iter__ASyncGeneratorFunction(PyObject *o)
|
|
|
21587
21701
|
#endif
|
|
21588
21702
|
PyObject_GC_UnTrack(o);
|
|
21589
21703
|
Py_CLEAR(p->_cache_handle);
|
|
21704
|
+
Py_CLEAR(p->__wrapped__);
|
|
21590
21705
|
Py_CLEAR(p->__weakself__);
|
|
21591
21706
|
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
|
|
21592
21707
|
(*Py_TYPE(o)->tp_free)(o);
|
|
@@ -21604,6 +21719,9 @@ static int __pyx_tp_traverse_6a_sync_4iter__ASyncGeneratorFunction(PyObject *o,
|
|
|
21604
21719
|
if (p->_cache_handle) {
|
|
21605
21720
|
e = (*v)(p->_cache_handle, a); if (e) return e;
|
|
21606
21721
|
}
|
|
21722
|
+
if (p->__wrapped__) {
|
|
21723
|
+
e = (*v)(p->__wrapped__, a); if (e) return e;
|
|
21724
|
+
}
|
|
21607
21725
|
if (p->__weakself__) {
|
|
21608
21726
|
e = (*v)(p->__weakself__, a); if (e) return e;
|
|
21609
21727
|
}
|
|
@@ -21616,6 +21734,9 @@ static int __pyx_tp_clear_6a_sync_4iter__ASyncGeneratorFunction(PyObject *o) {
|
|
|
21616
21734
|
tmp = ((PyObject*)p->_cache_handle);
|
|
21617
21735
|
p->_cache_handle = Py_None; Py_INCREF(Py_None);
|
|
21618
21736
|
Py_XDECREF(tmp);
|
|
21737
|
+
tmp = ((PyObject*)p->__wrapped__);
|
|
21738
|
+
p->__wrapped__ = Py_None; Py_INCREF(Py_None);
|
|
21739
|
+
Py_XDECREF(tmp);
|
|
21619
21740
|
tmp = ((PyObject*)p->__weakself__);
|
|
21620
21741
|
p->__weakself__ = Py_None; Py_INCREF(Py_None);
|
|
21621
21742
|
Py_XDECREF(tmp);
|
|
@@ -21638,6 +21759,19 @@ static PyObject *__pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction__cache_ha
|
|
|
21638
21759
|
return __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_13_cache_handle_1__get__(o);
|
|
21639
21760
|
}
|
|
21640
21761
|
|
|
21762
|
+
static PyObject *__pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction___wrapped__(PyObject *o, CYTHON_UNUSED void *x) {
|
|
21763
|
+
return __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___1__get__(o);
|
|
21764
|
+
}
|
|
21765
|
+
|
|
21766
|
+
static int __pyx_setprop_6a_sync_4iter_23_ASyncGeneratorFunction___wrapped__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
|
|
21767
|
+
if (v) {
|
|
21768
|
+
return __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___3__set__(o, v);
|
|
21769
|
+
}
|
|
21770
|
+
else {
|
|
21771
|
+
return __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_11__wrapped___5__del__(o);
|
|
21772
|
+
}
|
|
21773
|
+
}
|
|
21774
|
+
|
|
21641
21775
|
static PyObject *__pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction___weakself__(PyObject *o, CYTHON_UNUSED void *x) {
|
|
21642
21776
|
return __pyx_pw_6a_sync_4iter_23_ASyncGeneratorFunction_12__weakself___1__get__(o);
|
|
21643
21777
|
}
|
|
@@ -21656,6 +21790,7 @@ static PyMethodDef __pyx_methods_6a_sync_4iter__ASyncGeneratorFunction[] = {
|
|
|
21656
21790
|
static struct PyGetSetDef __pyx_getsets_6a_sync_4iter__ASyncGeneratorFunction[] = {
|
|
21657
21791
|
{(char *)"__self__", __pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction___self__, 0, (char *)PyDoc_STR("_ASyncGeneratorFunction.__self__: object"), 0},
|
|
21658
21792
|
{(char *)"_cache_handle", __pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction__cache_handle, 0, (char *)0, 0},
|
|
21793
|
+
{(char *)"__wrapped__", __pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction___wrapped__, __pyx_setprop_6a_sync_4iter_23_ASyncGeneratorFunction___wrapped__, (char *)PyDoc_STR("__wrapped__: object"), 0},
|
|
21659
21794
|
{(char *)"__weakself__", __pyx_getprop_6a_sync_4iter_23_ASyncGeneratorFunction___weakself__, 0, (char *)0, 0},
|
|
21660
21795
|
{0, 0, 0, 0, 0}
|
|
21661
21796
|
};
|
|
Binary file
|
a_sync/iter.pxd
CHANGED
|
@@ -2,6 +2,8 @@ from cpython.object cimport PyObject
|
|
|
2
2
|
|
|
3
3
|
cdef class _ASyncGeneratorFunction:
|
|
4
4
|
cdef readonly object _cache_handle
|
|
5
|
+
# must be public for functools.wraps
|
|
6
|
+
cdef public object __wrapped__
|
|
5
7
|
cdef readonly object __weakself__
|
|
6
8
|
cdef PyObject *__weakself_ptr
|
|
7
9
|
cdef inline void _set_cache_handle(self, object handle)
|
a_sync/task.py
CHANGED
|
@@ -43,6 +43,9 @@ logger = getLogger(__name__)
|
|
|
43
43
|
MappingFn = Callable[Concatenate[K, P], Awaitable[V]]
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
_args = WeakKeyDictionary()
|
|
47
|
+
|
|
48
|
+
|
|
46
49
|
class TaskMapping(DefaultDict[K, "Task[V]"], AsyncIterable[Tuple[K, V]]):
|
|
47
50
|
"""
|
|
48
51
|
A mapping of keys to asynchronous tasks with additional functionality.
|
|
@@ -157,6 +160,9 @@ class TaskMapping(DefaultDict[K, "Task[V]"], AsyncIterable[Tuple[K, V]]):
|
|
|
157
160
|
|
|
158
161
|
if iterables:
|
|
159
162
|
|
|
163
|
+
set_next = self._next.set
|
|
164
|
+
clear_next = self._next.clear
|
|
165
|
+
|
|
160
166
|
@wraps(wrapped_func)
|
|
161
167
|
async def _wrapped_set_next(
|
|
162
168
|
*args: P.args, __a_sync_recursion: int = 0, **kwargs: P.kwargs
|
|
@@ -167,17 +173,27 @@ class TaskMapping(DefaultDict[K, "Task[V]"], AsyncIterable[Tuple[K, V]]):
|
|
|
167
173
|
e.args = *e.args, f"wrapped:{self.__wrapped__}"
|
|
168
174
|
raise
|
|
169
175
|
except TypeError as e:
|
|
170
|
-
if
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
if (
|
|
177
|
+
args is None
|
|
178
|
+
or __a_sync_recursion > 2
|
|
179
|
+
or not (
|
|
180
|
+
str(e).startswith(wrapped_func.__name__)
|
|
181
|
+
and "got multiple values for argument" in str(e)
|
|
182
|
+
)
|
|
173
183
|
):
|
|
174
184
|
raise
|
|
185
|
+
|
|
175
186
|
# NOTE: args ordering is clashing with provided kwargs. We can handle this in a hacky way.
|
|
176
187
|
# TODO: perform this check earlier and pre-prepare the args/kwargs ordering
|
|
188
|
+
try:
|
|
189
|
+
argspec = _args[self.__wrapped__]
|
|
190
|
+
except KeyError:
|
|
191
|
+
argspec = _args[self.__wrapped__] = getfullargspec(self.__wrapped__).args
|
|
192
|
+
|
|
177
193
|
new_args = list(args)
|
|
178
194
|
new_kwargs = dict(kwargs)
|
|
179
195
|
try:
|
|
180
|
-
for i, arg in enumerate(
|
|
196
|
+
for i, arg in enumerate(argspec):
|
|
181
197
|
if arg in kwargs:
|
|
182
198
|
new_args.insert(i, new_kwargs.pop(arg))
|
|
183
199
|
else:
|
|
@@ -194,8 +210,8 @@ class TaskMapping(DefaultDict[K, "Task[V]"], AsyncIterable[Tuple[K, V]]):
|
|
|
194
210
|
else e2.with_traceback(e2.__traceback__)
|
|
195
211
|
)
|
|
196
212
|
finally:
|
|
197
|
-
|
|
198
|
-
|
|
213
|
+
set_next()
|
|
214
|
+
clear_next()
|
|
199
215
|
|
|
200
216
|
self._wrapped_func = _wrapped_set_next
|
|
201
217
|
init_loader_queue: Queue[Tuple[K, "Future[V]"]] = Queue()
|