python-dependency-injector/src/dependency_injector/providers.c

30132 lines
1.3 MiB
C
Raw Normal View History

/* Generated by Cython 0.25.2 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
#error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
#if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
#define HAVE_LONG_LONG
#endif
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#elif defined(PYSTON_VERSION)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#if PY_MAJOR_VERSION < 3
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 1
#endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#undef SHIFT
#undef BASE
#undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#define __Pyx_PyCFunctionFast _PyCFunctionFast
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
#define PyUnicode_1BYTE_KIND 1
#define PyUnicode_2BYTE_KIND 2
#define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
#define PyObject_ASCII(o) PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyNumber_Int PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
#ifndef PyUnicode_InternFromString
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#endif
#if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
# if defined(__cplusplus)
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#elif defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
__pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#ifndef __PYX_EXTERN_C
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#define __PYX_HAVE__dependency_injector__providers
#define __PYX_HAVE_API__dependency_injector__providers
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
#if defined (__cplusplus) && __cplusplus >= 201103L
#include <cstdlib>
#define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
#define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
#define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
const Py_UNICODE *u_end = u;
while (*u_end++) ;
return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
PyObject* ascii_chars_u = NULL;
PyObject* ascii_chars_b = NULL;
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
if (strcmp(default_encoding_c, "ascii") == 0) {
__Pyx_sys_getdefaultencoding_not_ascii = 0;
} else {
char ascii_chars[128];
int c;
for (c = 0; c < 128; c++) {
ascii_chars[c] = c;
}
__Pyx_sys_getdefaultencoding_not_ascii = 1;
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
if (!ascii_chars_u) goto bad;
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
PyErr_Format(
PyExc_ValueError,
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
default_encoding_c);
goto bad;
}
Py_DECREF(ascii_chars_u);
Py_DECREF(ascii_chars_b);
}
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
Py_XDECREF(ascii_chars_u);
Py_XDECREF(ascii_chars_b);
return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
return -1;
}
#endif
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"src/dependency_injector/providers.pxd",
"src/dependency_injector/providers.pyx",
};
/*--- Type declarations ---*/
struct __pyx_obj_19dependency_injector_9providers_Provider;
struct __pyx_obj_19dependency_injector_9providers_Object;
struct __pyx_obj_19dependency_injector_9providers_Delegate;
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency;
struct __pyx_obj_19dependency_injector_9providers_OverridingContext;
struct __pyx_obj_19dependency_injector_9providers_Callable;
struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable;
2017-04-06 18:17:06 +03:00
struct __pyx_obj_19dependency_injector_9providers_AbstractCallable;
2017-07-09 23:29:33 +03:00
struct __pyx_obj_19dependency_injector_9providers_CallableDelegate;
struct __pyx_obj_19dependency_injector_9providers_Configuration;
struct __pyx_obj_19dependency_injector_9providers_Factory;
struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory;
2017-04-06 18:17:06 +03:00
struct __pyx_obj_19dependency_injector_9providers_AbstractFactory;
2017-07-09 23:13:10 +03:00
struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate;
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton;
struct __pyx_obj_19dependency_injector_9providers_Singleton;
struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton;
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton;
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton;
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
2017-04-06 18:17:06 +03:00
struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton;
struct __pyx_obj_19dependency_injector_9providers_Injection;
struct __pyx_obj_19dependency_injector_9providers_PositionalInjection;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":174
*
*
* cpdef object deepcopy(object instance, dict memo=*) # <<<<<<<<<<<<<<
*
*
*/
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy {
int __pyx_n;
PyObject *memo;
};
/* "dependency_injector/providers.pxd":10
*
* # Base providers
* cdef class Provider(object): # <<<<<<<<<<<<<<
* cdef tuple __overridden
* cdef Provider __last_overriding
*/
struct __pyx_obj_19dependency_injector_9providers_Provider {
PyObject_HEAD
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *__pyx_vtab;
PyObject *__pyx___overridden;
struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx___last_overriding;
PyObject *__pyx___overriding_lock;
};
/* "dependency_injector/providers.pxd":18
*
*
* cdef class Object(Provider): # <<<<<<<<<<<<<<
* cdef object __provides
*
*/
struct __pyx_obj_19dependency_injector_9providers_Object {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
PyObject *__pyx___provides;
};
/* "dependency_injector/providers.pxd":24
*
*
* cdef class Delegate(Object): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_Delegate {
struct __pyx_obj_19dependency_injector_9providers_Object __pyx_base;
};
/* "dependency_injector/providers.pxd":28
*
*
* cdef class ExternalDependency(Provider): # <<<<<<<<<<<<<<
* cdef type __instance_of
*
*/
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
PyTypeObject *__pyx___instance_of;
};
/* "dependency_injector/providers.pxd":32
*
*
* cdef class OverridingContext(object): # <<<<<<<<<<<<<<
* cdef Provider __overridden
* cdef Provider __overriding
*/
struct __pyx_obj_19dependency_injector_9providers_OverridingContext {
PyObject_HEAD
struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx___overridden;
struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx___overriding;
};
/* "dependency_injector/providers.pxd":38
*
* # Callable providers
* cdef class Callable(Provider): # <<<<<<<<<<<<<<
* cdef object __provides
*
*/
struct __pyx_obj_19dependency_injector_9providers_Callable {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
PyObject *__pyx___provides;
PyObject *__pyx___args;
int __pyx___args_len;
PyObject *__pyx___kwargs;
int __pyx___kwargs_len;
};
/* "dependency_injector/providers.pxd":50
*
*
* cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable {
struct __pyx_obj_19dependency_injector_9providers_Callable __pyx_base;
};
/* "dependency_injector/providers.pxd":54
2017-04-06 18:17:06 +03:00
*
*
* cdef class AbstractCallable(Callable): # <<<<<<<<<<<<<<
* cpdef object _provide(self, tuple args, dict kwargs)
*
*/
struct __pyx_obj_19dependency_injector_9providers_AbstractCallable {
struct __pyx_obj_19dependency_injector_9providers_Callable __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":58
*
*
* cdef class CallableDelegate(Delegate): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_CallableDelegate {
struct __pyx_obj_19dependency_injector_9providers_Delegate __pyx_base;
};
/* "dependency_injector/providers.pxd":63
*
* # Configuration providers
* cdef class Configuration(Provider): # <<<<<<<<<<<<<<
* cdef str __name
* cdef object __value
*/
struct __pyx_obj_19dependency_injector_9providers_Configuration {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
PyObject *__pyx___name;
PyObject *__pyx___value;
PyObject *__pyx___children;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":75
*
* # Factory providers
* cdef class Factory(Provider): # <<<<<<<<<<<<<<
* cdef Callable __instantiator
*
*/
struct __pyx_obj_19dependency_injector_9providers_Factory {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx___instantiator;
PyObject *__pyx___attributes;
int __pyx___attributes_len;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":84
*
*
* cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory {
struct __pyx_obj_19dependency_injector_9providers_Factory __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":88
2017-04-06 18:17:06 +03:00
*
*
* cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<<
* cpdef object _provide(self, tuple args, dict kwargs)
*
*/
struct __pyx_obj_19dependency_injector_9providers_AbstractFactory {
struct __pyx_obj_19dependency_injector_9providers_Factory __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":92
2017-07-09 23:13:10 +03:00
*
*
* cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate {
struct __pyx_obj_19dependency_injector_9providers_Delegate __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":97
*
* # Singleton providers
* cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<<
* cdef Factory __instantiator
*
*/
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton {
struct __pyx_obj_19dependency_injector_9providers_Provider __pyx_base;
struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx___instantiator;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":101
*
*
* cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<<
* cdef object __storage
*
*/
struct __pyx_obj_19dependency_injector_9providers_Singleton {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton __pyx_base;
PyObject *__pyx___storage;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":107
*
*
* cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton {
struct __pyx_obj_19dependency_injector_9providers_Singleton __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":111
*
*
* cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* cdef object __storage
* cdef object __storage_lock
*/
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton __pyx_base;
PyObject *__pyx___storage;
PyObject *__pyx___storage_lock;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":118
*
*
* cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton {
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":122
*
*
* cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* cdef object __storage
*
*/
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton __pyx_base;
PyObject *__pyx___storage;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":128
*
*
* cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton {
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":132
2017-04-06 18:17:06 +03:00
*
*
* cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":137
*
* # Injections
* cdef class Injection(object): # <<<<<<<<<<<<<<
* cdef object __value
* cdef int __is_provider
*/
struct __pyx_obj_19dependency_injector_9providers_Injection {
PyObject_HEAD
PyObject *__pyx___value;
int __pyx___is_provider;
int __pyx___is_delegated;
int __pyx___call;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":144
*
*
* cdef class PositionalInjection(Injection): # <<<<<<<<<<<<<<
* pass
*
*/
struct __pyx_obj_19dependency_injector_9providers_PositionalInjection {
struct __pyx_obj_19dependency_injector_9providers_Injection __pyx_base;
};
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":148
*
*
* cdef class NamedInjection(Injection): # <<<<<<<<<<<<<<
* cdef object __name
*
*/
struct __pyx_obj_19dependency_injector_9providers_NamedInjection {
struct __pyx_obj_19dependency_injector_9providers_Injection __pyx_base;
PyObject *__pyx___name;
};
/* "dependency_injector/providers.pyx":28
*
*
* cdef class Provider(object): # <<<<<<<<<<<<<<
* """Base provider class.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider {
PyObject *(*_provide)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *__pyx_vtabptr_19dependency_injector_9providers_Provider;
/* "dependency_injector/providers.pyx":208
*
*
* cdef class Object(Provider): # <<<<<<<<<<<<<<
* """Object provider returns provided instance "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Object {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Object *__pyx_vtabptr_19dependency_injector_9providers_Object;
/* "dependency_injector/providers.pyx":268
*
*
* cdef class Delegate(Object): # <<<<<<<<<<<<<<
* """Delegate provider returns provider "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate {
struct __pyx_vtabstruct_19dependency_injector_9providers_Object __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate *__pyx_vtabptr_19dependency_injector_9providers_Delegate;
/* "dependency_injector/providers.pyx":287
*
*
* cdef class ExternalDependency(Provider): # <<<<<<<<<<<<<<
* """:py:class:`ExternalDependency` provider describes dependency interface.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_ExternalDependency {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ExternalDependency *__pyx_vtabptr_19dependency_injector_9providers_ExternalDependency;
/* "dependency_injector/providers.pyx":419
*
*
* cdef class Callable(Provider): # <<<<<<<<<<<<<<
* r"""Callable provider calls wrapped callable on every call.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Callable {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Callable *__pyx_vtabptr_19dependency_injector_9providers_Callable;
/* "dependency_injector/providers.pyx":600
*
*
* cdef class DelegatedCallable(Callable): # <<<<<<<<<<<<<<
* """Callable that is injected "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedCallable {
struct __pyx_vtabstruct_19dependency_injector_9providers_Callable __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedCallable *__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable;
/* "dependency_injector/providers.pyx":609
2017-04-06 18:17:06 +03:00
*
*
* cdef class AbstractCallable(Callable): # <<<<<<<<<<<<<<
* """Abstract callable provider.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable {
struct __pyx_vtabstruct_19dependency_injector_9providers_Callable __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable *__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable;
/* "dependency_injector/providers.pyx":650
2017-07-09 23:29:33 +03:00
*
*
* cdef class CallableDelegate(Delegate): # <<<<<<<<<<<<<<
* """Callable delegate injects delegating callable "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate {
struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate *__pyx_vtabptr_19dependency_injector_9providers_CallableDelegate;
/* "dependency_injector/providers.pyx":672
*
*
* cdef class Configuration(Provider): # <<<<<<<<<<<<<<
* """Configuration provider.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
PyObject *(*get_name)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, int __pyx_skip_dispatch);
PyObject *(*update)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, PyObject *, int __pyx_skip_dispatch);
PyObject *(*_get_child_name)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *__pyx_vtabptr_19dependency_injector_9providers_Configuration;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":797
*
*
* cdef class Factory(Provider): # <<<<<<<<<<<<<<
* r"""Factory provider creates new instance on every call.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Factory {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Factory *__pyx_vtabptr_19dependency_injector_9providers_Factory;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1030
*
*
* cdef class DelegatedFactory(Factory): # <<<<<<<<<<<<<<
* """Factory that is injected "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory {
struct __pyx_vtabstruct_19dependency_injector_9providers_Factory __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory *__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1051
2017-04-06 18:17:06 +03:00
*
*
2017-04-06 18:17:06 +03:00
* cdef class AbstractFactory(Factory): # <<<<<<<<<<<<<<
* """Abstract factory provider.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory {
struct __pyx_vtabstruct_19dependency_injector_9providers_Factory __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory *__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1092
2017-07-09 23:13:10 +03:00
*
*
* cdef class FactoryDelegate(Delegate): # <<<<<<<<<<<<<<
* """Factory delegate injects delegating factory "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate {
struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate *__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1114
2017-07-09 23:13:10 +03:00
*
*
* cdef class BaseSingleton(Provider): # <<<<<<<<<<<<<<
* """Base class of singleton providers."""
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1288
*
*
* cdef class Singleton(BaseSingleton): # <<<<<<<<<<<<<<
* """Singleton provider returns same instance on every call.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton *__pyx_vtabptr_19dependency_injector_9providers_Singleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1349
*
*
* cdef class DelegatedSingleton(Singleton): # <<<<<<<<<<<<<<
* """Delegated singleton is injected "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1370
*
*
* cdef class ThreadSafeSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* """Thread-safe singleton provider."""
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1411
*
*
* cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton): # <<<<<<<<<<<<<<
* """Delegated thread-safe singleton is injected "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1432
*
*
* cdef class ThreadLocalSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* """Thread-local singleton provides single objects in scope of thread.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1485
*
*
* cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton): # <<<<<<<<<<<<<<
* """Delegated thread-local singleton is injected "as is".
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton *__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1506
2017-04-06 18:17:06 +03:00
*
*
* cdef class AbstractSingleton(BaseSingleton): # <<<<<<<<<<<<<<
* """Abstract singleton provider.
*
*/
struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractSingleton {
struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton __pyx_base;
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractSingleton *__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton;
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#define __Pyx_RefNannyFinishContext()\
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_XDECREF(tmp);\
} while (0)
#define __Pyx_DECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_DECREF(tmp);\
} while (0)
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_getattr))
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif
/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
#endif
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
/* PyObjectLookupSpecial.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
PyObject *res;
PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
if (unlikely(PyInstance_Check(obj)))
return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
res = _PyType_Lookup(tp, attr_name);
if (likely(res)) {
descrgetfunc f = Py_TYPE(res)->tp_descr_get;
if (!f) {
Py_INCREF(res);
} else {
res = f(res, obj, (PyObject *)tp);
}
} else {
PyErr_SetObject(PyExc_AttributeError, attr_name);
}
return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif
/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#endif
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
#endif
/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_Join _PyString_Join
#else
#define __Pyx_PyBytes_Join _PyBytes_Join
#endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif
/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
Py_INCREF(x);
PyList_SET_ITEM(list, len, x);
Py_SIZE(list) = len+1;
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
/* bytes_tailmatch.proto */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
Py_ssize_t start, Py_ssize_t end, int direction);
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction);
/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction);
/* str_tailmatch.proto */
static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start,
Py_ssize_t end, int direction);
/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_setattro))
return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
if (likely(tp->tp_setattr))
return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
/* UnpackUnboundCMethod.proto */
typedef struct {
PyObject *type;
PyObject **method_name;
PyCFunction func;
PyObject *method;
int flag;
} __Pyx_CachedCFunction;
/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
((likely((cfunc)->func)) ?\
(likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
(likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
(PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ? (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :\
__Pyx__CallUnboundCMethod0(cfunc, self))))) :\
__Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
#endif
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
int full_traceback, int nogil);
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
if (unlikely(!none))
return -1;
Py_DECREF(none);
return 0;
#else
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}
/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
PyObject_RichCompare(op1, op2, Py_EQ)
#endif
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
PyObject *func_classobj;
void *defaults;
int defaults_pyobjects;
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *self,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
size_t size,
int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(void);
/* CodeObjectCache.proto */
typedef struct {
PyCodeObject* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static PyObject *__pyx_f_19dependency_injector_9providers_8Provider__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_6Object__provide(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_8Callable__provide(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_f_19dependency_injector_9providers_16AbstractCallable__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration_get_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration_update(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration__provide(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration__get_child_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_child_name, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_7Factory__provide(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_f_19dependency_injector_9providers_15AbstractFactory__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_9Singleton__provide(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_19ThreadSafeSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_20ThreadLocalSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch); /* proto*/
/* Module declarations from 'cython' */
/* Module declarations from 'dependency_injector.providers' */
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Provider = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Object = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Delegate = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_ExternalDependency = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_OverridingContext = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Callable = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedCallable = 0;
2017-04-06 18:17:06 +03:00
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_AbstractCallable = 0;
2017-07-09 23:29:33 +03:00
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_CallableDelegate = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Configuration = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Factory = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedFactory = 0;
2017-04-06 18:17:06 +03:00
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_AbstractFactory = 0;
2017-07-09 23:13:10 +03:00
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_FactoryDelegate = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_BaseSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Singleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton = 0;
2017-04-06 18:17:06 +03:00
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_AbstractSingleton = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_Injection = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_PositionalInjection = 0;
static PyTypeObject *__pyx_ptype_19dependency_injector_9providers_NamedInjection = 0;
static PyObject *__pyx_v_19dependency_injector_9providers_CLASS_TYPES = 0;
static PyObject *__pyx_f_19dependency_injector_9providers_parse_positional_injections(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_parse_named_injections(PyObject *, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_19dependency_injector_9providers_is_provider(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_ensure_is_provider(PyObject *, int __pyx_skip_dispatch); /*proto*/
static int __pyx_f_19dependency_injector_9providers_is_delegated(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_represent_provider(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_deepcopy(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_19dependency_injector_9providers_deepcopy *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_name(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_value(struct __pyx_obj_19dependency_injector_9providers_Injection *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provide_positional_args(PyObject *, PyObject *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provide_keyword_args(PyObject *, PyObject *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject_attributes(PyObject *, PyObject *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callable_call(struct __pyx_obj_19dependency_injector_9providers_Callable *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factory_call(struct __pyx_obj_19dependency_injector_9providers_Factory *, PyObject *, PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "dependency_injector.providers"
int __pyx_module_is_main_dependency_injector__providers = 0;
/* Implementation of 'dependency_injector.providers' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_hex;
static const char __pyx_k__7[] = ".";
static const char __pyx_k__9[] = "__";
static const char __pyx_k_id[] = "id";
static const char __pyx_k__10[] = "";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_memo[] = "memo";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_Error[] = "Error";
static const char __pyx_k_RLock[] = "RLock";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_range[] = "range";
2017-04-06 18:17:06 +03:00
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_address[] = "address";
static const char __pyx_k_default[] = "default";
2017-07-09 23:13:10 +03:00
static const char __pyx_k_factory[] = "factory";
static const char __pyx_k_im_func[] = "im_func";
static const char __pyx_k_im_self[] = "im_self";
static const char __pyx_k_provide[] = "_provide";
static const char __pyx_k_add_args[] = "add_args";
2017-07-09 23:29:33 +03:00
static const char __pyx_k_callable[] = "callable";
static const char __pyx_k_deepcopy[] = "deepcopy";
static const char __pyx_k_get_name[] = "get_name";
static const char __pyx_k_im_class[] = "im_class";
static const char __pyx_k_instance[] = "instance";
static const char __pyx_k_override[] = "override";
static const char __pyx_k_provider[] = "provider";
static const char __pyx_k_provides[] = "provides";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_set_args[] = "set_args";
static const char __pyx_k_ClassType[] = "ClassType";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_MethodType[] = "MethodType";
static const char __pyx_k_add_kwargs[] = "add_kwargs";
static const char __pyx_k_attributes[] = "attributes";
static const char __pyx_k_clear_args[] = "clear_args";
static const char __pyx_k_overridden[] = "overridden";
static const char __pyx_k_overriding[] = "overriding";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_set_kwargs[] = "set_kwargs";
static const char __pyx_k_0_is_not_an[] = "{0} is not an ";
static const char __pyx_k_CLASS_TYPES[] = "CLASS_TYPES";
static const char __pyx_k_IS_PROVIDER[] = "__IS_PROVIDER__";
static const char __pyx_k_instance_of[] = "instance_of";
static const char __pyx_k_IS_DELEGATED[] = "__IS_DELEGATED__";
static const char __pyx_k_clear_kwargs[] = "clear_kwargs";
static const char __pyx_k_storage_lock[] = "storage_lock";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_instance_of_0[] = "instance of {0}";
static const char __pyx_k_provided_type[] = "provided_type";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_add_attributes[] = "add_attributes";
static const char __pyx_k_attribute_name[] = "attribute_name";
static const char __pyx_k_get_child_name[] = "_get_child_name";
static const char __pyx_k_set_attributes[] = "set_attributes";
static const char __pyx_k_overriding_lock[] = "overriding_lock";
static const char __pyx_k_clear_attributes[] = "clear_attributes";
static const char __pyx_k_deepcopy_dispatch[] = "_deepcopy_dispatch";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_reset_last_overriding[] = "reset_last_overriding";
static const char __pyx_k_Dependency_is_not_defined[] = "Dependency is not defined";
2017-07-09 23:13:10 +03:00
static const char __pyx_k_0_can_wrap_only_1_providers[] = "{0} can wrap only {1} providers";
static const char __pyx_k_Provider_0_is_not_overridden[] = "Provider {0} is not overridden";
static const char __pyx_k_provider_provides_at_address[] = "<{provider}({provides}) at {address}>";
static const char __pyx_k_dependency_injector_providers[] = "dependency_injector.providers";
static const char __pyx_k_0_can_provide_only_1_instances[] = "{0} can provide only {1} instances";
2017-04-06 18:17:06 +03:00
static const char __pyx_k_0_must_be_overridden_only_by_1[] = "{0} must be overridden only by {1} providers";
static const char __pyx_k_0_must_be_overridden_before_cal[] = "{0} must be overridden before calling";
static const char __pyx_k_cls_object_has_no_attribute_att[] = "'{cls}' object has no attribute '{attribute_name}'";
2017-04-06 18:17:06 +03:00
static const char __pyx_k_Abstract_provider_forward_provid[] = "Abstract provider forward providing logic to overriding provider";
static const char __pyx_k_Dependency_injector_providers_Po[] = "Dependency injector providers.\n\nPowered by Cython.\n";
static const char __pyx_k_Expected_provider_instance_got_0[] = "Expected provider instance, got {0}";
static const char __pyx_k_Provider_0_could_not_be_overridd[] = "Provider {0} could not be overridden with itself";
static const char __pyx_k_Provider_0_expected_to_get_calla[] = "Provider {0} expected to get callable, got {0}";
static PyObject *__pyx_kp_s_0_can_provide_only_1_instances;
2017-07-09 23:13:10 +03:00
static PyObject *__pyx_kp_s_0_can_wrap_only_1_providers;
static PyObject *__pyx_kp_s_0_is_not_an;
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_kp_s_0_must_be_overridden_before_cal;
static PyObject *__pyx_kp_s_0_must_be_overridden_only_by_1;
static PyObject *__pyx_kp_s_Abstract_provider_forward_provid;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_CLASS_TYPES;
static PyObject *__pyx_n_s_ClassType;
static PyObject *__pyx_kp_s_Dependency_is_not_defined;
static PyObject *__pyx_n_s_Error;
static PyObject *__pyx_kp_s_Expected_provider_instance_got_0;
static PyObject *__pyx_n_s_IS_DELEGATED;
static PyObject *__pyx_n_s_IS_PROVIDER;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_MethodType;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_Provider_0_could_not_be_overridd;
static PyObject *__pyx_kp_s_Provider_0_expected_to_get_calla;
static PyObject *__pyx_kp_s_Provider_0_is_not_overridden;
static PyObject *__pyx_n_s_RLock;
static PyObject *__pyx_kp_s__10;
static PyObject *__pyx_kp_s__7;
static PyObject *__pyx_n_s__9;
static PyObject *__pyx_n_s_add_args;
static PyObject *__pyx_n_s_add_attributes;
static PyObject *__pyx_n_s_add_kwargs;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_attribute_name;
static PyObject *__pyx_n_s_attributes;
2017-07-09 23:29:33 +03:00
static PyObject *__pyx_n_s_callable;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear_args;
static PyObject *__pyx_n_s_clear_attributes;
static PyObject *__pyx_n_s_clear_kwargs;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_kp_s_cls_object_has_no_attribute_att;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_deepcopy;
static PyObject *__pyx_n_s_deepcopy_dispatch;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_dependency_injector_providers;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_errors;
static PyObject *__pyx_n_s_exit;
2017-07-09 23:13:10 +03:00
static PyObject *__pyx_n_s_factory;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_child_name;
static PyObject *__pyx_n_s_get_name;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_im_class;
static PyObject *__pyx_n_s_im_func;
static PyObject *__pyx_n_s_im_self;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_instance;
static PyObject *__pyx_n_s_instance_of;
static PyObject *__pyx_kp_s_instance_of_0;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_local;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_memo;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_overridden;
static PyObject *__pyx_n_s_override;
static PyObject *__pyx_n_s_overriding;
static PyObject *__pyx_n_s_overriding_lock;
static PyObject *__pyx_n_s_provide;
static PyObject *__pyx_n_s_provided_type;
static PyObject *__pyx_n_s_provider;
static PyObject *__pyx_kp_s_provider_provides_at_address;
static PyObject *__pyx_n_s_provides;
static PyObject *__pyx_n_s_pyx_capi;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_reset_last_overriding;
static PyObject *__pyx_n_s_set_args;
static PyObject *__pyx_n_s_set_attributes;
static PyObject *__pyx_n_s_set_kwargs;
static PyObject *__pyx_n_s_storage_lock;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_lambda_funcdef_19dependency_injector_9providers_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_memo); /* proto */
static int __pyx_pf_19dependency_injector_9providers_8Provider___init__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_2__call__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_4__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_6__str__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_8__repr__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_10overridden___get__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_15last_overriding___get__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_10override(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_provider); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_12reset_last_overriding(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_14reset_override(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_16delegate(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_18_provide(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_19dependency_injector_9providers_6Object___init__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_provides); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_4__str__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_6__repr__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_8_provide(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_19dependency_injector_9providers_8Delegate___init__(struct __pyx_obj_19dependency_injector_9providers_Delegate *__pyx_v_self, PyObject *__pyx_v_provides); /* proto */
static int __pyx_pf_19dependency_injector_9providers_18ExternalDependency___init__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyTypeObject *__pyx_v_instance_of); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_4__call__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_6__str__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_8__repr__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_11instance_of___get__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_10provided_by(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_provider); /* proto */
static int __pyx_pf_19dependency_injector_9providers_17OverridingContext___init__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self, struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overridden, struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overriding); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_17OverridingContext_2__enter__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_17OverridingContext_4__exit__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__); /* proto */
static int __pyx_pf_19dependency_injector_9providers_8Callable___init__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_4__str__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_8provides___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_4args___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_6add_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_8set_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_10clear_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_18_provide(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_provider); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable_4_provide(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2017-07-09 23:29:33 +03:00
static int __pyx_pf_19dependency_injector_9providers_16CallableDelegate___init__(struct __pyx_obj_19dependency_injector_9providers_CallableDelegate *__pyx_v_self, PyObject *__pyx_v_callable); /* proto */
static int __pyx_pf_19dependency_injector_9providers_13Configuration___init__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_4__str__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_6__getattr__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_8get_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_10update(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_12_provide(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_14_get_child_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_child_name); /* proto */
static int __pyx_pf_19dependency_injector_9providers_7Factory___init__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_4__str__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_3cls___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_4args___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_6add_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_8set_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_10clear_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_10attributes___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_18add_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_20set_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_22clear_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_24_provide(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_provider); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory_4_provide(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2017-07-09 23:13:10 +03:00
static int __pyx_pf_19dependency_injector_9providers_15FactoryDelegate___init__(struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate *__pyx_v_self, PyObject *__pyx_v_factory); /* proto */
static int __pyx_pf_19dependency_injector_9providers_13BaseSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_2__str__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_4__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_3cls___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_4args___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_6add_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_8set_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_10clear_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_10attributes___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_18add_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_20set_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_22clear_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_24reset(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self); /* proto */
static int __pyx_pf_19dependency_injector_9providers_9Singleton___init__(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_9Singleton_2reset(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_9Singleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_2reset(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_2reset(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self, PyObject *__pyx_v_provider); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton_4reset(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self); /* proto */
static int __pyx_pf_19dependency_injector_9providers_19PositionalInjection___init__(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_4get_value(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_6get_original_value(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self); /* proto */
static int __pyx_pf_19dependency_injector_9providers_14NamedInjection___init__(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_4get_name(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_6get_value(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_8get_original_value(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_parse_positional_injections(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_2parse_named_injections(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_4is_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_6ensure_is_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_8is_delegated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_10represent_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_provider, PyObject *__pyx_v_provides); /* proto */
static PyObject *__pyx_pf_19dependency_injector_9providers_12deepcopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Provider(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Delegate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ExternalDependency(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_OverridingContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Callable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedCallable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractCallable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2017-07-09 23:29:33 +03:00
static PyObject *__pyx_tp_new_19dependency_injector_9providers_CallableDelegate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Configuration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Factory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2017-07-09 23:13:10 +03:00
static PyObject *__pyx_tp_new_19dependency_injector_9providers_FactoryDelegate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_BaseSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Singleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ThreadSafeSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadSafeSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ThreadLocalSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadLocalSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractSingleton(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Injection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_PositionalInjection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_19dependency_injector_9providers_NamedInjection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static PyObject *__pyx_int_3;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
/* "dependency_injector/providers.pyx":23
*
* copy._deepcopy_dispatch[types.MethodType] = \
* lambda obj, memo: type(obj)(obj.im_func, # <<<<<<<<<<<<<<
* copy.deepcopy(obj.im_self, memo),
* obj.im_class)
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_14lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_19dependency_injector_9providers_14lambda = {"lambda", (PyCFunction)__pyx_pw_19dependency_injector_9providers_14lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_19dependency_injector_9providers_14lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_obj = 0;
PyObject *__pyx_v_memo = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("lambda (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_memo,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_memo)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(1, 23, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(1, 23, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_obj = values[0];
__pyx_v_memo = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 23, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_lambda_funcdef_19dependency_injector_9providers_lambda(__pyx_self, __pyx_v_obj, __pyx_v_memo);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_lambda_funcdef_19dependency_injector_9providers_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("lambda", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_im_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "dependency_injector/providers.pyx":24
* copy._deepcopy_dispatch[types.MethodType] = \
* lambda obj, memo: type(obj)(obj.im_func,
* copy.deepcopy(obj.im_self, memo), # <<<<<<<<<<<<<<
* obj.im_class)
*
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_im_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_memo};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_memo};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
__Pyx_INCREF(__pyx_v_memo);
__Pyx_GIVEREF(__pyx_v_memo);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_memo);
__pyx_t_4 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "dependency_injector/providers.pyx":25
* lambda obj, memo: type(obj)(obj.im_func,
* copy.deepcopy(obj.im_self, memo),
* obj.im_class) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_im_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
__pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_obj)); __pyx_t_4 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_5);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_5 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":23
*
* copy._deepcopy_dispatch[types.MethodType] = \
* lambda obj, memo: type(obj)(obj.im_func, # <<<<<<<<<<<<<<
* copy.deepcopy(obj.im_self, memo),
* obj.im_class)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":83
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__overridden = tuple()
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_8Provider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider___init__[] = "Initializer.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Provider___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_8Provider_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider___init__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_8Provider___init__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":85
* def __init__(self):
* """Initializer."""
* self.__overridden = tuple() # <<<<<<<<<<<<<<
* self.__last_overriding = None
* self.__overriding_lock = self.__class__.overriding_lock
*/
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___overridden);
__Pyx_DECREF(__pyx_v_self->__pyx___overridden);
__pyx_v_self->__pyx___overridden = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":86
* """Initializer."""
* self.__overridden = tuple()
* self.__last_overriding = None # <<<<<<<<<<<<<<
* self.__overriding_lock = self.__class__.overriding_lock
* super(Provider, self).__init__()
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___last_overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_v_self->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None);
/* "dependency_injector/providers.pyx":87
* self.__overridden = tuple()
* self.__last_overriding = None
* self.__overriding_lock = self.__class__.overriding_lock # <<<<<<<<<<<<<<
* super(Provider, self).__init__()
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_overriding_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___overriding_lock);
__Pyx_DECREF(__pyx_v_self->__pyx___overriding_lock);
__pyx_v_self->__pyx___overriding_lock = __pyx_t_2;
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":88
* self.__last_overriding = None
* self.__overriding_lock = self.__class__.overriding_lock
* super(Provider, self).__init__() # <<<<<<<<<<<<<<
*
* def __call__(self, *args, **kwargs):
*/
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
if (__pyx_t_3) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":83
* """
*
* def __init__(self): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__overridden = tuple()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Provider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":90
* super(Provider, self).__init__()
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_2__call__[] = "Return provided object.\n\n Callable interface implementation.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Provider_2__call__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_2__call__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_2__call__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
/* "dependency_injector/providers.pyx":95
* Callable interface implementation.
* """
* if self.__last_overriding is not None: # <<<<<<<<<<<<<<
* return self.__last_overriding._provide(args, kwargs)
* return self._provide(args, kwargs)
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx___last_overriding) != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":96
* """
* if self.__last_overriding is not None:
* return self.__last_overriding._provide(args, kwargs) # <<<<<<<<<<<<<<
* return self._provide(args, kwargs)
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx___last_overriding->__pyx_vtab)->_provide(__pyx_v_self->__pyx___last_overriding, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":95
* Callable interface implementation.
* """
* if self.__last_overriding is not None: # <<<<<<<<<<<<<<
* return self.__last_overriding._provide(args, kwargs)
* return self._provide(args, kwargs)
*/
}
/* "dependency_injector/providers.pyx":97
* if self.__last_overriding is not None:
* return self.__last_overriding._provide(args, kwargs)
* return self._provide(args, kwargs) # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx_vtab)->_provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":90
* super(Provider, self).__init__()
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Provider.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":99
* return self._provide(args, kwargs)
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_5__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_4__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_5__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_4__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_4__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "dependency_injector/providers.pyx":101
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":102
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":103
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
* copied = self.__class__()
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":102
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
/* "dependency_injector/providers.pyx":105
* return copied
*
* copied = self.__class__() # <<<<<<<<<<<<<<
*
* for overriding_provider in self.overridden:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_5) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":107
* copied = self.__class__()
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 107, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 107, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 107, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 107, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":108
*
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
* return copied
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 108, __pyx_L1_error)
__pyx_t_10.__pyx_n = 1;
__pyx_t_10.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":107
* copied = self.__class__()
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":110
* copied.override(deepcopy(overriding_provider, memo))
*
* return copied # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":99
* return self._provide(args, kwargs)
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.Provider.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":112
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_7__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_6__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Provider_6__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_7__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_6__str__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_6__str__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "dependency_injector/providers.pyx":117
* :rtype: str
* """
* return represent_provider(provider=self, provides=None) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), Py_None, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":112
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Provider.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":119
* return represent_provider(provider=self, provides=None)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_8__repr__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Provider_8__repr__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_8__repr__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_8__repr__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "dependency_injector/providers.pyx":124
* :rtype: str
* """
* return self.__str__() # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":119
* return represent_provider(provider=self, provides=None)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Provider.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":127
*
* @property
* def overridden(self): # <<<<<<<<<<<<<<
* """Return tuple of overriding providers."""
* with self.__overriding_lock:
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_10overridden_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_10overridden_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_10overridden___get__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_10overridden___get__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":129
* def overridden(self):
* """Return tuple of overriding providers."""
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* return self.__overridden
*
*/
/*with:*/ {
__pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 129, __pyx_L3_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 129, __pyx_L3_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/*try:*/ {
{
if (__pyx_t_5||__pyx_t_6||__pyx_t_7); else {/*mark used*/}
/*try:*/ {
/* "dependency_injector/providers.pyx":130
* """Return tuple of overriding providers."""
* with self.__overriding_lock:
* return self.__overridden # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___overridden);
__pyx_r = __pyx_v_self->__pyx___overridden;
goto __pyx_L11_try_return;
/* "dependency_injector/providers.pyx":129
* def overridden(self):
* """Return tuple of overriding providers."""
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* return self.__overridden
*
*/
}
__pyx_L11_try_return:;
goto __pyx_L4_return;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_1) {
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
goto __pyx_L6;
}
__pyx_L4_return: {
__pyx_t_7 = __pyx_r;
__pyx_r = 0;
if (__pyx_t_1) {
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
}
__pyx_L6:;
}
goto __pyx_L15;
__pyx_L3_error:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L1_error;
__pyx_L15:;
}
/* "dependency_injector/providers.pyx":127
*
* @property
* def overridden(self): # <<<<<<<<<<<<<<
* """Return tuple of overriding providers."""
* with self.__overriding_lock:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("dependency_injector.providers.Provider.overridden.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":133
*
* @property
* def last_overriding(self): # <<<<<<<<<<<<<<
* """Return last overriding provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_15last_overriding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_15last_overriding_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_15last_overriding___get__(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_15last_overriding___get__(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":138
* If provider is not overridden, then None is returned.
* """
* return self.__last_overriding # <<<<<<<<<<<<<<
*
* def override(self, provider):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_r = ((PyObject *)__pyx_v_self->__pyx___last_overriding);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":133
*
* @property
* def last_overriding(self): # <<<<<<<<<<<<<<
* """Return last overriding provider.
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":140
* return self.__last_overriding
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_11override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_10override[] = "Override provider with another provider.\n\n :param provider: Overriding provider.\n :type provider: :py:class:`Provider`\n\n :raise: :py:exc:`dependency_injector.errors.Error`\n\n :return: Overriding context.\n :rtype: :py:class:`OverridingContext`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_11override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("override (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_10override(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self), ((PyObject *)__pyx_v_provider));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_10override(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
__Pyx_RefNannySetupContext("override", 0);
__Pyx_INCREF(__pyx_v_provider);
/* "dependency_injector/providers.pyx":151
* :rtype: :py:class:`OverridingContext`
* """
* if provider is self: # <<<<<<<<<<<<<<
* raise Error('Provider {0} could not be overridden '
* 'with itself'.format(self))
*/
__pyx_t_1 = (__pyx_v_provider == ((PyObject *)__pyx_v_self));
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":152
* """
* if provider is self:
* raise Error('Provider {0} could not be overridden ' # <<<<<<<<<<<<<<
* 'with itself'.format(self))
*
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "dependency_injector/providers.pyx":153
* if provider is self:
* raise Error('Provider {0} could not be overridden '
* 'with itself'.format(self)) # <<<<<<<<<<<<<<
*
* if not is_provider(provider):
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provider_0_could_not_be_overridd, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (!__pyx_t_7) {
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_self));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 152, __pyx_L1_error)
/* "dependency_injector/providers.pyx":151
* :rtype: :py:class:`OverridingContext`
* """
* if provider is self: # <<<<<<<<<<<<<<
* raise Error('Provider {0} could not be overridden '
* 'with itself'.format(self))
*/
}
/* "dependency_injector/providers.pyx":155
* 'with itself'.format(self))
*
* if not is_provider(provider): # <<<<<<<<<<<<<<
* provider = Object(provider)
*
*/
__pyx_t_2 = ((!(__pyx_f_19dependency_injector_9providers_is_provider(__pyx_v_provider, 0) != 0)) != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":156
*
* if not is_provider(provider):
* provider = Object(provider) # <<<<<<<<<<<<<<
*
* with self.__overriding_lock:
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_provider);
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Object), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_provider, __pyx_t_4);
__pyx_t_4 = 0;
/* "dependency_injector/providers.pyx":155
* 'with itself'.format(self))
*
* if not is_provider(provider): # <<<<<<<<<<<<<<
* provider = Object(provider)
*
*/
}
/* "dependency_injector/providers.pyx":158
* provider = Object(provider)
*
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden += (provider,)
* self.__last_overriding = provider
*/
/*with:*/ {
__pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 158, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_8) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 158, __pyx_L5_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 158, __pyx_L5_error)
}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
/*try:*/ {
/* "dependency_injector/providers.pyx":159
*
* with self.__overriding_lock:
* self.__overridden += (provider,) # <<<<<<<<<<<<<<
* self.__last_overriding = provider
*
*/
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 159, __pyx_L9_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_provider);
__pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___overridden, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L9_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->__pyx___overridden);
__Pyx_DECREF(__pyx_v_self->__pyx___overridden);
__pyx_v_self->__pyx___overridden = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":160
* with self.__overriding_lock:
* self.__overridden += (provider,)
* self.__last_overriding = provider # <<<<<<<<<<<<<<
*
* return OverridingContext(self, provider)
*/
if (!(likely(((__pyx_v_provider) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_provider, __pyx_ptype_19dependency_injector_9providers_Provider))))) __PYX_ERR(1, 160, __pyx_L9_error)
__pyx_t_3 = __pyx_v_provider;
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->__pyx___last_overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_v_self->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_t_3);
__pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":158
* provider = Object(provider)
*
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden += (provider,)
* self.__last_overriding = provider
*/
}
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
goto __pyx_L16_try_end;
__pyx_L9_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/*except:*/ {
__Pyx_AddTraceback("dependency_injector.providers.Provider.override", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(1, 158, __pyx_L11_except_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 158, __pyx_L11_except_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 158, __pyx_L11_except_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (__pyx_t_2 < 0) __PYX_ERR(1, 158, __pyx_L11_except_error)
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_1) {
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_8);
__pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0;
__PYX_ERR(1, 158, __pyx_L11_except_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L10_exception_handled;
}
__pyx_L11_except_error:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
goto __pyx_L1_error;
__pyx_L10_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
__pyx_L16_try_end:;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_9) {
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__3, NULL);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
goto __pyx_L8;
}
__pyx_L8:;
}
goto __pyx_L20;
__pyx_L5_error:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L1_error;
__pyx_L20:;
}
/* "dependency_injector/providers.pyx":162
* self.__last_overriding = provider
*
* return OverridingContext(self, provider) # <<<<<<<<<<<<<<
*
* def reset_last_overriding(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_provider);
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_OverridingContext), __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":140
* return self.__last_overriding
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.Provider.override", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":164
* return OverridingContext(self, provider)
*
* def reset_last_overriding(self): # <<<<<<<<<<<<<<
* """Reset last overriding provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_13reset_last_overriding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_12reset_last_overriding[] = "Reset last overriding provider.\n\n :raise: :py:exc:`dependency_injector.errors.Error` if provider is not\n overridden.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_13reset_last_overriding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset_last_overriding (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_12reset_last_overriding(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_12reset_last_overriding(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
int __pyx_t_17;
int __pyx_t_18;
__Pyx_RefNannySetupContext("reset_last_overriding", 0);
/* "dependency_injector/providers.pyx":172
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* if len(self.__overridden) == 0:
* raise Error('Provider {0} is not overridden'.format(str(self)))
*/
/*with:*/ {
__pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 172, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L3_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L3_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/*try:*/ {
/* "dependency_injector/providers.pyx":173
* """
* with self.__overriding_lock:
* if len(self.__overridden) == 0: # <<<<<<<<<<<<<<
* raise Error('Provider {0} is not overridden'.format(str(self)))
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___overridden;
__Pyx_INCREF(__pyx_t_2);
if (unlikely(__pyx_t_2 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 173, __pyx_L7_error)
}
__pyx_t_8 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 173, __pyx_L7_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = ((__pyx_t_8 == 0) != 0);
if (__pyx_t_9) {
/* "dependency_injector/providers.pyx":174
* with self.__overriding_lock:
* if len(self.__overridden) == 0:
* raise Error('Provider {0} is not overridden'.format(str(self))) # <<<<<<<<<<<<<<
*
* self.__overridden = self.__overridden[:-1]
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provider_0_is_not_overridden, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_self));
__pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
}
}
if (!__pyx_t_11) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_12};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_12};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
#endif
{
__pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
__Pyx_GIVEREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_12);
__pyx_t_12 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_10) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_4};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(1, 174, __pyx_L7_error)
/* "dependency_injector/providers.pyx":173
* """
* with self.__overriding_lock:
* if len(self.__overridden) == 0: # <<<<<<<<<<<<<<
* raise Error('Provider {0} is not overridden'.format(str(self)))
*
*/
}
/* "dependency_injector/providers.pyx":176
* raise Error('Provider {0} is not overridden'.format(str(self)))
*
* self.__overridden = self.__overridden[:-1] # <<<<<<<<<<<<<<
* try:
* self.__last_overriding = self.__overridden[-1]
*/
if (unlikely(__pyx_v_self->__pyx___overridden == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 176, __pyx_L7_error)
}
__pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_v_self->__pyx___overridden, 0, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 176, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___overridden);
__Pyx_DECREF(__pyx_v_self->__pyx___overridden);
__pyx_v_self->__pyx___overridden = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":177
*
* self.__overridden = self.__overridden[:-1]
* try: # <<<<<<<<<<<<<<
* self.__last_overriding = self.__overridden[-1]
* except IndexError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
__Pyx_XGOTREF(__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_16);
/*try:*/ {
/* "dependency_injector/providers.pyx":178
* self.__overridden = self.__overridden[:-1]
* try:
* self.__last_overriding = self.__overridden[-1] # <<<<<<<<<<<<<<
* except IndexError:
* self.__last_overriding = None
*/
if (unlikely(__pyx_v_self->__pyx___overridden == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 178, __pyx_L16_error)
}
__pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___overridden, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 178, __pyx_L16_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_19dependency_injector_9providers_Provider))))) __PYX_ERR(1, 178, __pyx_L16_error)
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___last_overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_v_self->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":177
*
* self.__overridden = self.__overridden[:-1]
* try: # <<<<<<<<<<<<<<
* self.__last_overriding = self.__overridden[-1]
* except IndexError:
*/
}
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
goto __pyx_L23_try_end;
__pyx_L16_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":179
* try:
* self.__last_overriding = self.__overridden[-1]
* except IndexError: # <<<<<<<<<<<<<<
* self.__last_overriding = None
*
*/
__pyx_t_17 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
if (__pyx_t_17) {
__Pyx_AddTraceback("dependency_injector.providers.Provider.reset_last_overriding", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_13) < 0) __PYX_ERR(1, 179, __pyx_L18_except_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_13);
/* "dependency_injector/providers.pyx":180
* self.__last_overriding = self.__overridden[-1]
* except IndexError:
* self.__last_overriding = None # <<<<<<<<<<<<<<
*
* def reset_override(self):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___last_overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_v_self->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
goto __pyx_L17_exception_handled;
}
goto __pyx_L18_except_error;
__pyx_L18_except_error:;
/* "dependency_injector/providers.pyx":177
*
* self.__overridden = self.__overridden[:-1]
* try: # <<<<<<<<<<<<<<
* self.__last_overriding = self.__overridden[-1]
* except IndexError:
*/
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
goto __pyx_L7_error;
__pyx_L17_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
__pyx_L23_try_end:;
}
/* "dependency_injector/providers.pyx":172
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* if len(self.__overridden) == 0:
* raise Error('Provider {0} is not overridden'.format(str(self)))
*/
}
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L14_try_end;
__pyx_L7_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
/*except:*/ {
__Pyx_AddTraceback("dependency_injector.providers.Provider.reset_last_overriding", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(1, 172, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_Pack(3, __pyx_t_13, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 172, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
if (__pyx_t_9 < 0) __PYX_ERR(1, 172, __pyx_L9_except_error)
__pyx_t_18 = ((!(__pyx_t_9 != 0)) != 0);
if (__pyx_t_18) {
__Pyx_GIVEREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_3, __pyx_t_2);
__pyx_t_13 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0;
__PYX_ERR(1, 172, __pyx_L9_except_error)
}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L8_exception_handled;
}
__pyx_L9_except_error:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L1_error;
__pyx_L8_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
__pyx_L14_try_end:;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_1) {
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
goto __pyx_L6;
}
__pyx_L6:;
}
goto __pyx_L29;
__pyx_L3_error:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L1_error;
__pyx_L29:;
}
/* "dependency_injector/providers.pyx":164
* return OverridingContext(self, provider)
*
* def reset_last_overriding(self): # <<<<<<<<<<<<<<
* """Reset last overriding provider.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("dependency_injector.providers.Provider.reset_last_overriding", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":182
* self.__last_overriding = None
*
* def reset_override(self): # <<<<<<<<<<<<<<
* """Reset all overriding providers.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_15reset_override(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_14reset_override[] = "Reset all overriding providers.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_15reset_override(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset_override (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_14reset_override(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_14reset_override(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int __pyx_t_11;
__Pyx_RefNannySetupContext("reset_override", 0);
/* "dependency_injector/providers.pyx":187
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden = tuple()
* self.__last_overriding = None
*/
/*with:*/ {
__pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___overriding_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 187, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 187, __pyx_L3_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 187, __pyx_L3_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/*try:*/ {
/* "dependency_injector/providers.pyx":188
* """
* with self.__overriding_lock:
* self.__overridden = tuple() # <<<<<<<<<<<<<<
* self.__last_overriding = None
*
*/
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L7_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___overridden);
__Pyx_DECREF(__pyx_v_self->__pyx___overridden);
__pyx_v_self->__pyx___overridden = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":189
* with self.__overriding_lock:
* self.__overridden = tuple()
* self.__last_overriding = None # <<<<<<<<<<<<<<
*
* def delegate(self):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___last_overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___last_overriding));
__pyx_v_self->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None);
/* "dependency_injector/providers.pyx":187
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden = tuple()
* self.__last_overriding = None
*/
}
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L14_try_end;
__pyx_L7_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
/*except:*/ {
__Pyx_AddTraceback("dependency_injector.providers.Provider.reset_override", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(1, 187, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 187, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 187, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_10 < 0) __PYX_ERR(1, 187, __pyx_L9_except_error)
__pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4);
__pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0;
__PYX_ERR(1, 187, __pyx_L9_except_error)
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L8_exception_handled;
}
__pyx_L9_except_error:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L1_error;
__pyx_L8_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
__pyx_L14_try_end:;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_1) {
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
goto __pyx_L6;
}
__pyx_L6:;
}
goto __pyx_L18;
__pyx_L3_error:;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L1_error;
__pyx_L18:;
}
/* "dependency_injector/providers.pyx":182
* self.__last_overriding = None
*
* def reset_override(self): # <<<<<<<<<<<<<<
* """Reset all overriding providers.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.Provider.reset_override", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":191
* self.__last_overriding = None
*
* def delegate(self): # <<<<<<<<<<<<<<
* """Return provider's delegate.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_17delegate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_16delegate[] = "Return provider's delegate.\n\n :rtype: :py:class:`Delegate`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_17delegate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("delegate (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_16delegate(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_16delegate(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("delegate", 0);
/* "dependency_injector/providers.pyx":196
* :rtype: :py:class:`Delegate`
* """
* return Delegate(self) # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":191
* self.__last_overriding = None
*
* def delegate(self): # <<<<<<<<<<<<<<
* """Return provider's delegate.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Provider.delegate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":198
* return Delegate(self)
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Providing strategy implementation.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_8Provider__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_19_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "dependency_injector/providers.pyx":205
* overridden provider is called. Need to be overridden in subclasses.
* """
* raise NotImplementedError() # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(1, 205, __pyx_L1_error)
/* "dependency_injector/providers.pyx":198
* return Delegate(self)
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Providing strategy implementation.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.Provider._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Provider_18_provide[] = "Providing strategy implementation.\n\n Abstract protected method that implements providing strategy of\n particular provider. Current method is called every time when not\n overridden provider is called. Need to be overridden in subclasses.\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Provider_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 198, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 198, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 198, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Provider._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 198, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 198, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Provider_18_provide(((struct __pyx_obj_19dependency_injector_9providers_Provider *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Provider_18_provide(struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_8Provider__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Provider._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":218
* """
*
* def __init__(self, provides): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_6Object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6Object___init__[] = "Initializer.\n\n :param provides: Value that have to be provided.\n :type provides: object\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_6Object___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_6Object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 218, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 218, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_6Object___init__(((struct __pyx_obj_19dependency_injector_9providers_Object *)__pyx_v_self), __pyx_v_provides);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_6Object___init__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_provides) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":224
* :type provides: object
* """
* self.__provides = provides # <<<<<<<<<<<<<<
* super(Object, self).__init__()
*
*/
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
__Pyx_GOTREF(__pyx_v_self->__pyx___provides);
__Pyx_DECREF(__pyx_v_self->__pyx___provides);
__pyx_v_self->__pyx___provides = __pyx_v_provides;
/* "dependency_injector/providers.pyx":225
* """
* self.__provides = provides
* super(Object, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Object));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Object));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Object));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":218
* """
*
* def __init__(self, provides): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":227
* super(Object, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6Object_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_6Object_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_Object *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "dependency_injector/providers.pyx":229
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":230
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":231
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
* copied = self.__class__(deepcopy(self.__provides, memo))
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":230
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
/* "dependency_injector/providers.pyx":233
* return copied
*
* copied = self.__class__(deepcopy(self.__provides, memo)) # <<<<<<<<<<<<<<
*
* for overriding_provider in self.overridden:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __pyx_v_self->__pyx___provides;
__Pyx_INCREF(__pyx_t_5);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 233, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_5) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":235
* copied = self.__class__(deepcopy(self.__provides, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
__pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 235, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 235, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 235, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_10(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 235, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":236
*
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
* return copied
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 236, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_5) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":235
* copied = self.__class__(deepcopy(self.__provides, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":238
* copied.override(deepcopy(overriding_provider, memo))
*
* return copied # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":227
* super(Object, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":240
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_5__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6Object_4__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_6Object_4__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_6Object_4__str__(((struct __pyx_obj_19dependency_injector_9providers_Object *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_4__str__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "dependency_injector/providers.pyx":245
* :rtype: str
* """
* return represent_provider(provider=self, provides=self.__provides) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_v_self->__pyx___provides;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":240
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Object.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":247
* return represent_provider(provider=self, provides=self.__provides)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_7__repr__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6Object_6__repr__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_6Object_6__repr__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_7__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_6Object_6__repr__(((struct __pyx_obj_19dependency_injector_9providers_Object *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_6__repr__(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "dependency_injector/providers.pyx":252
* :rtype: str
* """
* return self.__str__() # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":247
* return represent_provider(provider=self, provides=self.__provides)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Object.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":254
* return self.__str__()
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return provided instance.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_9_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_6Object__provide(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_6Object_9_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "dependency_injector/providers.pyx":265
* :rtype: object
* """
* return self.__provides # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___provides);
__pyx_r = __pyx_v_self->__pyx___provides;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":254
* return self.__str__()
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return provided instance.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.Object._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_9_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6Object_8_provide[] = "Return provided instance.\n\n :param args: Tuple of context positional arguments.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword arguments.\n :type kwargs: dict[str, object]\n\n :rtype: object\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_6Object_9_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 254, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 254, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 254, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Object._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 254, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 254, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_6Object_8_provide(((struct __pyx_obj_19dependency_injector_9providers_Object *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_6Object_8_provide(struct __pyx_obj_19dependency_injector_9providers_Object *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_6Object__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Object._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":278
* """
*
* def __init__(self, provides): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_8Delegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Delegate___init__[] = "Initializer.\n\n :param provides: Value that have to be provided.\n :type provides: object\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Delegate___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_8Delegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 278, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 278, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Delegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Delegate___init__(((struct __pyx_obj_19dependency_injector_9providers_Delegate *)__pyx_v_self), __pyx_v_provides);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_8Delegate___init__(struct __pyx_obj_19dependency_injector_9providers_Delegate *__pyx_v_self, PyObject *__pyx_v_provides) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":284
* :type provides: object
* """
* super(Delegate, self).__init__(ensure_is_provider(provides)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __pyx_f_19dependency_injector_9providers_ensure_is_provider(__pyx_v_provides, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_4) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":278
* """
*
* def __init__(self, provides): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.Delegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":309
* """
*
* def __init__(self, type instance_of): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__instance_of = instance_of
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_18ExternalDependency_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency___init__[] = "Initializer.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_18ExternalDependency_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyTypeObject *__pyx_v_instance_of = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_instance_of,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_instance_of)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 309, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_instance_of = ((PyTypeObject*)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 309, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_instance_of), (&PyType_Type), 1, "instance_of", 1))) __PYX_ERR(1, 309, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency___init__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self), __pyx_v_instance_of);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_18ExternalDependency___init__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyTypeObject *__pyx_v_instance_of) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":311
* def __init__(self, type instance_of):
* """Initializer."""
* self.__instance_of = instance_of # <<<<<<<<<<<<<<
* super(ExternalDependency, self).__init__()
*
*/
__Pyx_INCREF(((PyObject *)__pyx_v_instance_of));
__Pyx_GIVEREF(((PyObject *)__pyx_v_instance_of));
__Pyx_GOTREF(__pyx_v_self->__pyx___instance_of);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___instance_of));
__pyx_v_self->__pyx___instance_of = __pyx_v_instance_of;
/* "dependency_injector/providers.pyx":312
* """Initializer."""
* self.__instance_of = instance_of
* super(ExternalDependency, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ExternalDependency));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ExternalDependency));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_ExternalDependency));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 312, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 312, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":309
* """
*
* def __init__(self, type instance_of): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__instance_of = instance_of
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":314
* super(ExternalDependency, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "dependency_injector/providers.pyx":316
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":317
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":318
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
* copied = self.__class__(self.__instance_of)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":317
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
/* "dependency_injector/providers.pyx":320
* return copied
*
* copied = self.__class__(self.__instance_of) # <<<<<<<<<<<<<<
*
* for overriding_provider in self.overridden:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_5) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->__pyx___instance_of)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->__pyx___instance_of)};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->__pyx___instance_of)};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx___instance_of));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx___instance_of));
PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self->__pyx___instance_of));
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":322
* copied = self.__class__(self.__instance_of)
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 322, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 322, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 322, __pyx_L1_error)
#else
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 322, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":323
*
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
* return copied
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 323, __pyx_L1_error)
__pyx_t_10.__pyx_n = 1;
__pyx_t_10.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_5 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_5};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":322
* copied = self.__class__(self.__instance_of)
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":325
* copied.override(deepcopy(overriding_provider, memo))
*
* return copied # <<<<<<<<<<<<<<
*
* def __call__(self, *args, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":314
* super(ExternalDependency, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":327
* return copied
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided instance.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency_4__call__[] = "Return provided instance.\n\n :param args: Tuple of context positional arguments.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword arguments.\n :type kwargs: dict[str, object]\n\n :raise: :py:exc:`dependency_injector.errors.Error`\n\n :rtype: object\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_4__call__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_4__call__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_4__call__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_v_instance = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
/* "dependency_injector/providers.pyx":342
* cdef object instance
*
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('Dependency is not defined')
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx___last_overriding) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":343
*
* if self.__last_overriding is None:
* raise Error('Dependency is not defined') # <<<<<<<<<<<<<<
*
* instance = self.__last_overriding._provide(args, kwargs)
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(1, 343, __pyx_L1_error)
/* "dependency_injector/providers.pyx":342
* cdef object instance
*
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('Dependency is not defined')
*
*/
}
/* "dependency_injector/providers.pyx":345
* raise Error('Dependency is not defined')
*
* instance = self.__last_overriding._provide(args, kwargs) # <<<<<<<<<<<<<<
*
* if not isinstance(instance, self.instance_of):
*/
__pyx_t_4 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx_base.__pyx___last_overriding->__pyx_vtab)->_provide(__pyx_v_self->__pyx_base.__pyx___last_overriding, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 345, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_instance = __pyx_t_4;
__pyx_t_4 = 0;
/* "dependency_injector/providers.pyx":347
* instance = self.__last_overriding._provide(args, kwargs)
*
* if not isinstance(instance, self.instance_of): # <<<<<<<<<<<<<<
* raise Error('{0} is not an '.format(instance) +
* 'instance of {0}'.format(self.instance_of))
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instance_of); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyObject_IsInstance(__pyx_v_instance, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 347, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_1) {
/* "dependency_injector/providers.pyx":348
*
* if not isinstance(instance, self.instance_of):
* raise Error('{0} is not an '.format(instance) + # <<<<<<<<<<<<<<
* 'instance of {0}'.format(self.instance_of))
*
*/
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_is_not_an, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (!__pyx_t_7) {
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_instance); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_instance};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_instance};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_instance);
__Pyx_GIVEREF(__pyx_v_instance);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_instance);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "dependency_injector/providers.pyx":349
* if not isinstance(instance, self.instance_of):
* raise Error('{0} is not an '.format(instance) +
* 'instance of {0}'.format(self.instance_of)) # <<<<<<<<<<<<<<
*
* return instance
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_instance_of_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_instance_of); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
if (!__pyx_t_9) {
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
__pyx_t_7 = 0;
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "dependency_injector/providers.pyx":348
*
* if not isinstance(instance, self.instance_of):
* raise Error('{0} is not an '.format(instance) + # <<<<<<<<<<<<<<
* 'instance of {0}'.format(self.instance_of))
*
*/
__pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_6) {
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_8};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(1, 348, __pyx_L1_error)
/* "dependency_injector/providers.pyx":347
* instance = self.__last_overriding._provide(args, kwargs)
*
* if not isinstance(instance, self.instance_of): # <<<<<<<<<<<<<<
* raise Error('{0} is not an '.format(instance) +
* 'instance of {0}'.format(self.instance_of))
*/
}
/* "dependency_injector/providers.pyx":351
* 'instance of {0}'.format(self.instance_of))
*
* return instance # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_instance);
__pyx_r = __pyx_v_instance;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":327
* return copied
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided instance.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_instance);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":353
* return instance
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_7__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency_6__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_6__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_7__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_6__str__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_6__str__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "dependency_injector/providers.pyx":358
* :rtype: str
* """
* return represent_provider(provider=self, provides=self.__instance_of) # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instance_of);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":353
* return instance
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":360
* return represent_provider(provider=self, provides=self.__instance_of)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_9__repr__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency_8__repr__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_8__repr__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_9__repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_8__repr__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_8__repr__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__repr__", 0);
/* "dependency_injector/providers.pyx":365
* :rtype: str
* """
* return self.__str__() # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 365, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":360
* return represent_provider(provider=self, provides=self.__instance_of)
*
* def __repr__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":368
*
* @property
* def instance_of(self): # <<<<<<<<<<<<<<
* """Return class of required dependency."""
* return self.__instance_of
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_11instance_of_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_11instance_of_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_11instance_of___get__(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_11instance_of___get__(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":370
* def instance_of(self):
* """Return class of required dependency."""
* return self.__instance_of # <<<<<<<<<<<<<<
*
* def provided_by(self, provider):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx___instance_of));
__pyx_r = ((PyObject *)__pyx_v_self->__pyx___instance_of);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":368
*
* @property
* def instance_of(self): # <<<<<<<<<<<<<<
* """Return class of required dependency."""
* return self.__instance_of
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":372
* return self.__instance_of
*
* def provided_by(self, provider): # <<<<<<<<<<<<<<
* """Set external dependency provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_11provided_by(PyObject *__pyx_v_self, PyObject *__pyx_v_provider); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_18ExternalDependency_10provided_by[] = "Set external dependency provider.\n\n :param provider: Provider that provides required dependency.\n :type provider: :py:class:`Provider`\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_18ExternalDependency_11provided_by(PyObject *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("provided_by (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_18ExternalDependency_10provided_by(((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)__pyx_v_self), ((PyObject *)__pyx_v_provider));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_18ExternalDependency_10provided_by(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("provided_by", 0);
/* "dependency_injector/providers.pyx":380
* :rtype: None
* """
* return self.override(provider) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_override); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_provider); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_provider};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_provider};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_provider);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":372
* return self.__instance_of
*
* def provided_by(self, provider): # <<<<<<<<<<<<<<
* """Set external dependency provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("dependency_injector.providers.ExternalDependency.provided_by", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":397
* """
*
* def __init__(self, Provider overridden, Provider overriding): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_17OverridingContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17OverridingContext___init__[] = "Initializer.\n\n :param overridden: Overridden provider.\n :type overridden: :py:class:`Provider`\n\n :param overriding: Overriding provider.\n :type overriding: :py:class:`Provider`\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_17OverridingContext___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_17OverridingContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overridden = 0;
struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overriding = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overridden,&__pyx_n_s_overriding,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overridden)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overriding)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 397, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 397, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_overridden = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)values[0]);
__pyx_v_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 397, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.OverridingContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overridden), __pyx_ptype_19dependency_injector_9providers_Provider, 1, "overridden", 0))) __PYX_ERR(1, 397, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_overriding), __pyx_ptype_19dependency_injector_9providers_Provider, 1, "overriding", 0))) __PYX_ERR(1, 397, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_17OverridingContext___init__(((struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)__pyx_v_self), __pyx_v_overridden, __pyx_v_overriding);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_17OverridingContext___init__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self, struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overridden, struct __pyx_obj_19dependency_injector_9providers_Provider *__pyx_v_overriding) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":406
* :type overriding: :py:class:`Provider`
* """
* self.__overridden = overridden # <<<<<<<<<<<<<<
* self.__overriding = overriding
* super(OverridingContext, self).__init__()
*/
__Pyx_INCREF(((PyObject *)__pyx_v_overridden));
__Pyx_GIVEREF(((PyObject *)__pyx_v_overridden));
__Pyx_GOTREF(__pyx_v_self->__pyx___overridden);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___overridden));
__pyx_v_self->__pyx___overridden = __pyx_v_overridden;
/* "dependency_injector/providers.pyx":407
* """
* self.__overridden = overridden
* self.__overriding = overriding # <<<<<<<<<<<<<<
* super(OverridingContext, self).__init__()
*
*/
__Pyx_INCREF(((PyObject *)__pyx_v_overriding));
__Pyx_GIVEREF(((PyObject *)__pyx_v_overriding));
__Pyx_GOTREF(__pyx_v_self->__pyx___overriding);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___overriding));
__pyx_v_self->__pyx___overriding = __pyx_v_overriding;
/* "dependency_injector/providers.pyx":408
* self.__overridden = overridden
* self.__overriding = overriding
* super(OverridingContext, self).__init__() # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_OverridingContext));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_OverridingContext));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_OverridingContext));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 408, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 408, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":397
* """
*
* def __init__(self, Provider overridden, Provider overriding): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.OverridingContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":410
* super(OverridingContext, self).__init__()
*
* def __enter__(self): # <<<<<<<<<<<<<<
* """Do nothing."""
* return self.__overriding
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_17OverridingContext_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17OverridingContext_2__enter__[] = "Do nothing.";
static PyObject *__pyx_pw_19dependency_injector_9providers_17OverridingContext_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_17OverridingContext_2__enter__(((struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_17OverridingContext_2__enter__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__", 0);
/* "dependency_injector/providers.pyx":412
* def __enter__(self):
* """Do nothing."""
* return self.__overriding # <<<<<<<<<<<<<<
*
* def __exit__(self, *_):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx___overriding));
__pyx_r = ((PyObject *)__pyx_v_self->__pyx___overriding);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":410
* super(OverridingContext, self).__init__()
*
* def __enter__(self): # <<<<<<<<<<<<<<
* """Do nothing."""
* return self.__overriding
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":414
* return self.__overriding
*
* def __exit__(self, *_): # <<<<<<<<<<<<<<
* """Exit overriding context."""
* self.__overridden.reset_last_overriding()
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_17OverridingContext_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17OverridingContext_4__exit__[] = "Exit overriding context.";
static PyObject *__pyx_pw_19dependency_injector_9providers_17OverridingContext_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v__ = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v__ = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_17OverridingContext_4__exit__(((struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)__pyx_v_self), __pyx_v__);
/* function exit code */
__Pyx_XDECREF(__pyx_v__);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_17OverridingContext_4__exit__(struct __pyx_obj_19dependency_injector_9providers_OverridingContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__exit__", 0);
/* "dependency_injector/providers.pyx":416
* def __exit__(self, *_):
* """Exit overriding context."""
* self.__overridden.reset_last_overriding() # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___overridden), __pyx_n_s_reset_last_overriding); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":414
* return self.__overriding
*
* def __exit__(self, *_): # <<<<<<<<<<<<<<
* """Exit overriding context."""
* self.__overridden.reset_last_overriding()
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.OverridingContext.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":443
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_8Callable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable___init__[] = "Initializer.\n\n :param provides: Wrapped callable.\n :type provides: callable\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Callable___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_8Callable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 443, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 443, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("dependency_injector.providers.Callable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable___init__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_8Callable___init__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":455
* :type kwargs: dict[str, object]
* """
* if not callable(provides): # <<<<<<<<<<<<<<
* raise Error('Provider {0} expected to get callable, '
* 'got {0}'.format('.'.join((self.__class__.__module__,
*/
__pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_provides); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 455, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":456
* """
* if not callable(provides):
* raise Error('Provider {0} expected to get callable, ' # <<<<<<<<<<<<<<
* 'got {0}'.format('.'.join((self.__class__.__module__,
* self.__class__.__name__)),
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
/* "dependency_injector/providers.pyx":457
* if not callable(provides):
* raise Error('Provider {0} expected to get callable, '
* 'got {0}'.format('.'.join((self.__class__.__module__, # <<<<<<<<<<<<<<
* self.__class__.__name__)),
* provides))
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provider_0_expected_to_get_calla, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_module); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "dependency_injector/providers.pyx":458
* raise Error('Provider {0} expected to get callable, '
* 'got {0}'.format('.'.join((self.__class__.__module__,
* self.__class__.__name__)), # <<<<<<<<<<<<<<
* provides))
* self.__provides = provides
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "dependency_injector/providers.pyx":457
* if not callable(provides):
* raise Error('Provider {0} expected to get callable, '
* 'got {0}'.format('.'.join((self.__class__.__module__, # <<<<<<<<<<<<<<
* self.__class__.__name__)),
* provides))
*/
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
__pyx_t_8 = 0;
__pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "dependency_injector/providers.pyx":459
* 'got {0}'.format('.'.join((self.__class__.__module__,
* self.__class__.__name__)),
* provides)) # <<<<<<<<<<<<<<
* self.__provides = provides
*
*/
__pyx_t_7 = NULL;
__pyx_t_10 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_10 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_v_provides};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_v_provides};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_t_9);
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_v_provides);
__pyx_t_9 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 456, __pyx_L1_error)
/* "dependency_injector/providers.pyx":455
* :type kwargs: dict[str, object]
* """
* if not callable(provides): # <<<<<<<<<<<<<<
* raise Error('Provider {0} expected to get callable, '
* 'got {0}'.format('.'.join((self.__class__.__module__,
*/
}
/* "dependency_injector/providers.pyx":460
* self.__class__.__name__)),
* provides))
* self.__provides = provides # <<<<<<<<<<<<<<
*
* self.__args = tuple()
*/
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
__Pyx_GOTREF(__pyx_v_self->__pyx___provides);
__Pyx_DECREF(__pyx_v_self->__pyx___provides);
__pyx_v_self->__pyx___provides = __pyx_v_provides;
/* "dependency_injector/providers.pyx":462
* self.__provides = provides
*
* self.__args = tuple() # <<<<<<<<<<<<<<
* self.__args_len = 0
* self.set_args(*args)
*/
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->__pyx___args);
__Pyx_DECREF(__pyx_v_self->__pyx___args);
__pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":463
*
* self.__args = tuple()
* self.__args_len = 0 # <<<<<<<<<<<<<<
* self.set_args(*args)
*
*/
__pyx_v_self->__pyx___args_len = 0;
/* "dependency_injector/providers.pyx":464
* self.__args = tuple()
* self.__args_len = 0
* self.set_args(*args) # <<<<<<<<<<<<<<
*
* self.__kwargs = tuple()
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_args, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "dependency_injector/providers.pyx":466
* self.set_args(*args)
*
* self.__kwargs = tuple() # <<<<<<<<<<<<<<
* self.__kwargs_len = 0
* self.set_kwargs(**kwargs)
*/
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->__pyx___kwargs);
__Pyx_DECREF(__pyx_v_self->__pyx___kwargs);
__pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "dependency_injector/providers.pyx":467
*
* self.__kwargs = tuple()
* self.__kwargs_len = 0 # <<<<<<<<<<<<<<
* self.set_kwargs(**kwargs)
*
*/
__pyx_v_self->__pyx___kwargs_len = 0;
/* "dependency_injector/providers.pyx":468
* self.__kwargs = tuple()
* self.__kwargs_len = 0
* self.set_kwargs(**kwargs) # <<<<<<<<<<<<<<
*
* super(Callable, self).__init__()
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":470
* self.set_kwargs(**kwargs)
*
* super(Callable, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_8) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":443
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("dependency_injector.providers.Callable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":472
* super(Callable, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "dependency_injector/providers.pyx":474
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":475
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
/* "dependency_injector/providers.pyx":476
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
* copied = self.__class__(self.provides,
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":475
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
/* "dependency_injector/providers.pyx":478
* return copied
*
* copied = self.__class__(self.provides, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provides); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":479
*
* copied = self.__class__(self.provides,
* *deepcopy(self.args, memo), # <<<<<<<<<<<<<<
* **deepcopy(self.kwargs, memo))
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 479, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":478
* return copied
*
* copied = self.__class__(self.provides, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
__pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":480
* copied = self.__class__(self.provides,
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<<
*
* for overriding_provider in self.overridden:
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 480, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_3 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_t_3 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(1, 480, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_t_3))) {
__pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
/* "dependency_injector/providers.pyx":478
* return copied
*
* copied = self.__class__(self.provides, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3);
__pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":482
* **deepcopy(self.kwargs, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
__pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 482, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 482, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 482, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_10(__pyx_t_2);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 482, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_3);
__pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":483
*
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
* return copied
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 483, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_5) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
#endif
{
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 483, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":482
* **deepcopy(self.kwargs, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":485
* copied.override(deepcopy(overriding_provider, memo))
*
* return copied # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":472
* super(Callable, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.Callable.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":487
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_5__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_4__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_8Callable_4__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_4__str__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_4__str__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__str__", 0);
/* "dependency_injector/providers.pyx":492
* :rtype: str
* """
* return represent_provider(provider=self, provides=self.__provides) # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_v_self->__pyx___provides;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 492, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":487
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Callable.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":495
*
* @property
* def provides(self): # <<<<<<<<<<<<<<
* """Return wrapped callable."""
* return self.__provides
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_8provides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_8provides_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_8provides___get__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_8provides___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":497
* def provides(self):
* """Return wrapped callable."""
* return self.__provides # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___provides);
__pyx_r = __pyx_v_self->__pyx___provides;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":495
*
* @property
* def provides(self): # <<<<<<<<<<<<<<
* """Return wrapped callable."""
* return self.__provides
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":500
*
* @property
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* cdef int index
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_4args_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_4args___get__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_4args___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
int __pyx_v_index;
struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_arg = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":506
* cdef list args
*
* args = list() # <<<<<<<<<<<<<<
* for index in range(self.__args_len):
* arg = self.__args[index]
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":507
*
* args = list()
* for index in range(self.__args_len): # <<<<<<<<<<<<<<
* arg = self.__args[index]
* args.append(arg.__value)
*/
__pyx_t_2 = __pyx_v_self->__pyx___args_len;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_index = __pyx_t_3;
/* "dependency_injector/providers.pyx":508
* args = list()
* for index in range(self.__args_len):
* arg = self.__args[index] # <<<<<<<<<<<<<<
* args.append(arg.__value)
* return tuple(args)
*/
if (unlikely(__pyx_v_self->__pyx___args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 508, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___args, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_PositionalInjection))))) __PYX_ERR(1, 508, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_arg, ((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_t_1));
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":509
* for index in range(self.__args_len):
* arg = self.__args[index]
* args.append(arg.__value) # <<<<<<<<<<<<<<
* return tuple(args)
*
*/
__pyx_t_1 = __pyx_v_arg->__pyx_base.__pyx___value;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 509, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "dependency_injector/providers.pyx":510
* arg = self.__args[index]
* args.append(arg.__value)
* return tuple(args) # <<<<<<<<<<<<<<
*
* def add_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":500
*
* @property
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* cdef int index
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.args.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_arg);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":512
* return tuple(args)
*
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add postional argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_6add_args[] = "Add postional argument injections.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_6add_args(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_args);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_6add_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
__Pyx_RefNannySetupContext("add_args", 0);
/* "dependency_injector/providers.pyx":520
* :return: Reference ``self``
* """
* self.__args += parse_positional_injections(args) # <<<<<<<<<<<<<<
* self.__args_len = len(self.__args)
* return self
*/
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___args, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___args);
__Pyx_DECREF(__pyx_v_self->__pyx___args);
__pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":521
* """
* self.__args += parse_positional_injections(args)
* self.__args_len = len(self.__args) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___args;
__Pyx_INCREF(__pyx_t_2);
if (unlikely(__pyx_t_2 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 521, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 521, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->__pyx___args_len = __pyx_t_3;
/* "dependency_injector/providers.pyx":522
* self.__args += parse_positional_injections(args)
* self.__args_len = len(self.__args)
* return self # <<<<<<<<<<<<<<
*
* def set_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":512
* return tuple(args)
*
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Callable.add_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":524
* return self
*
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set postional argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_8set_args[] = "Set postional argument injections.\n\n Existing positional argument injections are dropped.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_8set_args(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_args);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_8set_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("set_args", 0);
/* "dependency_injector/providers.pyx":534
* :return: Reference ``self``
* """
* self.__args = parse_positional_injections(args) # <<<<<<<<<<<<<<
* self.__args_len = len(self.__args)
* return self
*/
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 534, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___args);
__Pyx_DECREF(__pyx_v_self->__pyx___args);
__pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":535
* """
* self.__args = parse_positional_injections(args)
* self.__args_len = len(self.__args) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_v_self->__pyx___args;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 535, __pyx_L1_error)
}
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___args_len = __pyx_t_2;
/* "dependency_injector/providers.pyx":536
* self.__args = parse_positional_injections(args)
* self.__args_len = len(self.__args)
* return self # <<<<<<<<<<<<<<
*
* def clear_args(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":524
* return self
*
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.set_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":538
* return self
*
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop postional argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_10clear_args[] = "Drop postional argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear_args (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_10clear_args(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_10clear_args(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("clear_args", 0);
/* "dependency_injector/providers.pyx":543
* :return: Reference ``self``
* """
* self.__args = tuple() # <<<<<<<<<<<<<<
* self.__args_len = len(self.__args)
* return self
*/
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___args);
__Pyx_DECREF(__pyx_v_self->__pyx___args);
__pyx_v_self->__pyx___args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":544
* """
* self.__args = tuple()
* self.__args_len = len(self.__args) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_v_self->__pyx___args;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 544, __pyx_L1_error)
}
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 544, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___args_len = __pyx_t_2;
/* "dependency_injector/providers.pyx":545
* self.__args = tuple()
* self.__args_len = len(self.__args)
* return self # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":538
* return self
*
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.clear_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":548
*
* @property
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* cdef int index
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_6kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_6kwargs_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_6kwargs___get__(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
int __pyx_v_index;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_kwarg = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
__Pyx_RefNannySetupContext("__get__", 0);
/* "dependency_injector/providers.pyx":554
* cdef dict kwargs
*
* kwargs = dict() # <<<<<<<<<<<<<<
* for index in range(self.__kwargs_len):
* kwarg = self.__kwargs[index]
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_kwargs = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":555
*
* kwargs = dict()
* for index in range(self.__kwargs_len): # <<<<<<<<<<<<<<
* kwarg = self.__kwargs[index]
* kwargs[kwarg.__name] = kwarg.__value
*/
__pyx_t_2 = __pyx_v_self->__pyx___kwargs_len;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_index = __pyx_t_3;
/* "dependency_injector/providers.pyx":556
* kwargs = dict()
* for index in range(self.__kwargs_len):
* kwarg = self.__kwargs[index] # <<<<<<<<<<<<<<
* kwargs[kwarg.__name] = kwarg.__value
* return kwargs
*/
if (unlikely(__pyx_v_self->__pyx___kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(1, 556, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___kwargs, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_NamedInjection))))) __PYX_ERR(1, 556, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_kwarg, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_1));
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":557
* for index in range(self.__kwargs_len):
* kwarg = self.__kwargs[index]
* kwargs[kwarg.__name] = kwarg.__value # <<<<<<<<<<<<<<
* return kwargs
*
*/
__pyx_t_1 = __pyx_v_kwarg->__pyx_base.__pyx___value;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_kwarg->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(1, 557, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "dependency_injector/providers.pyx":558
* kwarg = self.__kwargs[index]
* kwargs[kwarg.__name] = kwarg.__value
* return kwargs # <<<<<<<<<<<<<<
*
* def add_kwargs(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_kwargs);
__pyx_r = __pyx_v_kwargs;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":548
*
* @property
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* cdef int index
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.kwargs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_kwarg);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":560
* return kwargs
*
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add keyword argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_12add_kwargs[] = "Add keyword argument injections.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("add_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_kwargs", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_12add_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
__Pyx_RefNannySetupContext("add_kwargs", 0);
/* "dependency_injector/providers.pyx":568
* :return: Reference ``self``
* """
* self.__kwargs += parse_named_injections(kwargs) # <<<<<<<<<<<<<<
* self.__kwargs_len = len(self.__kwargs)
* return self
*/
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___kwargs, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___kwargs);
__Pyx_DECREF(__pyx_v_self->__pyx___kwargs);
__pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":569
* """
* self.__kwargs += parse_named_injections(kwargs)
* self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
__Pyx_INCREF(__pyx_t_2);
if (unlikely(__pyx_t_2 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 569, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 569, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->__pyx___kwargs_len = __pyx_t_3;
/* "dependency_injector/providers.pyx":570
* self.__kwargs += parse_named_injections(kwargs)
* self.__kwargs_len = len(self.__kwargs)
* return self # <<<<<<<<<<<<<<
*
* def set_kwargs(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":560
* return kwargs
*
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Callable.add_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":572
* return self
*
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set keyword argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_14set_kwargs[] = "Set keyword argument injections.\n\n Existing keyword argument injections are dropped.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("set_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_kwargs", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_14set_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("set_kwargs", 0);
/* "dependency_injector/providers.pyx":582
* :return: Reference ``self``
* """
* self.__kwargs = parse_named_injections(kwargs) # <<<<<<<<<<<<<<
* self.__kwargs_len = len(self.__kwargs)
* return self
*/
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___kwargs);
__Pyx_DECREF(__pyx_v_self->__pyx___kwargs);
__pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":583
* """
* self.__kwargs = parse_named_injections(kwargs)
* self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_v_self->__pyx___kwargs;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 583, __pyx_L1_error)
}
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 583, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___kwargs_len = __pyx_t_2;
/* "dependency_injector/providers.pyx":584
* self.__kwargs = parse_named_injections(kwargs)
* self.__kwargs_len = len(self.__kwargs)
* return self # <<<<<<<<<<<<<<
*
* def clear_kwargs(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":572
* return self
*
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.set_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":586
* return self
*
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop keyword argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_16clear_kwargs[] = "Drop keyword argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear_kwargs (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_16clear_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("clear_kwargs", 0);
/* "dependency_injector/providers.pyx":591
* :return: Reference ``self``
* """
* self.__kwargs = tuple() # <<<<<<<<<<<<<<
* self.__kwargs_len = len(self.__kwargs)
* return self
*/
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___kwargs);
__Pyx_DECREF(__pyx_v_self->__pyx___kwargs);
__pyx_v_self->__pyx___kwargs = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":592
* """
* self.__kwargs = tuple()
* self.__kwargs_len = len(self.__kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_v_self->__pyx___kwargs;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
__PYX_ERR(1, 592, __pyx_L1_error)
}
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 592, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___kwargs_len = __pyx_t_2;
/* "dependency_injector/providers.pyx":593
* self.__kwargs = tuple()
* self.__kwargs_len = len(self.__kwargs)
* return self # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "dependency_injector/providers.pyx":586
* return self
*
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable.clear_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":595
* return self
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* return __callable_call(self, args, kwargs)
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_8Callable__provide(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_19_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "dependency_injector/providers.pyx":597
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* return __callable_call(self, args, kwargs) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___callable_call(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 597, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":595
* return self
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* return __callable_call(self, args, kwargs)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.Callable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8Callable_18_provide[] = "Return result of provided callable's call.";
static PyObject *__pyx_pw_19dependency_injector_9providers_8Callable_19_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 595, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 595, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 595, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Callable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 595, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 595, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_8Callable_18_provide(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8Callable_18_provide(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_8Callable__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Callable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":619
* """
*
2017-04-06 18:17:06 +03:00
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_16AbstractCallable___call__[] = "Return provided object.\n\n Callable interface implementation.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
2017-04-06 18:17:06 +03:00
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_16AbstractCallable___call__;
#endif
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_16AbstractCallable___call__(((struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
/* "dependency_injector/providers.pyx":624
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":625
* """
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self)) # <<<<<<<<<<<<<<
* return self.__last_overriding._provide(args, kwargs)
*
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_before_cal, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (!__pyx_t_7) {
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_self));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 625, __pyx_L1_error)
/* "dependency_injector/providers.pyx":624
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
2017-04-06 18:17:06 +03:00
}
/* "dependency_injector/providers.pyx":626
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def override(self, provider):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding->__pyx_vtab)->_provide(__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":619
* """
*
2017-04-06 18:17:06 +03:00
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.AbstractCallable.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":628
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_16AbstractCallable_2override[] = "Override provider with another provider.\n\n :param provider: Overriding provider.\n :type provider: :py:class:`Provider`\n\n :raise: :py:exc:`dependency_injector.errors.Error`\n\n :return: Overriding context.\n :rtype: :py:class:`OverridingContext`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("override (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_16AbstractCallable_2override(((struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *)__pyx_v_self), ((PyObject *)__pyx_v_provider));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("override", 0);
/* "dependency_injector/providers.pyx":639
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, Callable): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Callable))
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_provider, __pyx_ptype_19dependency_injector_9providers_Callable);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":640
2017-04-06 18:17:06 +03:00
* """
* if not isinstance(provider, Callable):
* raise Error('{0} must be overridden only by ' # <<<<<<<<<<<<<<
* '{1} providers'.format(self, Callable))
* return super(AbstractCallable, self).override(provider)
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
/* "dependency_injector/providers.pyx":641
2017-04-06 18:17:06 +03:00
* if not isinstance(provider, Callable):
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Callable)) # <<<<<<<<<<<<<<
* return super(AbstractCallable, self).override(provider)
*
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_only_by_1, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 641, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable)};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable)};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 641, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 640, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
/* "dependency_injector/providers.pyx":639
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, Callable): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Callable))
*/
}
/* "dependency_injector/providers.pyx":642
2017-04-06 18:17:06 +03:00
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Callable))
* return super(AbstractCallable, self).override(provider) # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractCallable));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractCallable));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractCallable));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2017-04-06 18:17:06 +03:00
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_9) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_provider); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
2017-04-06 18:17:06 +03:00
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
2017-04-06 18:17:06 +03:00
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 642, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_provider);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 642, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "dependency_injector/providers.pyx":628
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
2017-04-06 18:17:06 +03:00
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("dependency_injector.providers.AbstractCallable.override", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":644
2017-04-06 18:17:06 +03:00
* return super(AbstractCallable, self).override(provider)
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic '
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_16AbstractCallable__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_16AbstractCallable_5_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
2017-04-06 18:17:06 +03:00
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 644, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-04-06 18:17:06 +03:00
}
/* "dependency_injector/providers.pyx":646
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic ' # <<<<<<<<<<<<<<
* 'to overriding provider')
*
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 646, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(1, 646, __pyx_L1_error)
/* "dependency_injector/providers.pyx":644
2017-04-06 18:17:06 +03:00
* return super(AbstractCallable, self).override(provider)
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic '
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.AbstractCallable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_16AbstractCallable_4_provide[] = "Return result of provided callable's call.";
static PyObject *__pyx_pw_19dependency_injector_9providers_16AbstractCallable_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 644, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 644, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 644, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.AbstractCallable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 644, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 644, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_16AbstractCallable_4_provide(((struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_16AbstractCallable_4_provide(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_16AbstractCallable__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.AbstractCallable._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":660
* """
*
* def __init__(self, callable): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_16CallableDelegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_16CallableDelegate___init__[] = "Initializer.\n\n :param provides: Value that have to be provided.\n :type provides: object\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_16CallableDelegate___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_16CallableDelegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_callable = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callable,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callable)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 660, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_callable = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 660, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.CallableDelegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_16CallableDelegate___init__(((struct __pyx_obj_19dependency_injector_9providers_CallableDelegate *)__pyx_v_self), __pyx_v_callable);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_16CallableDelegate___init__(struct __pyx_obj_19dependency_injector_9providers_CallableDelegate *__pyx_v_self, PyObject *__pyx_v_callable) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
/* "dependency_injector/providers.pyx":666
* :type provides: object
* """
* if isinstance(callable, Callable) is False: # <<<<<<<<<<<<<<
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Callable))
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_callable, __pyx_ptype_19dependency_injector_9providers_Callable);
__pyx_t_2 = ((__pyx_t_1 == 0) != 0);
if (__pyx_t_2) {
/* "dependency_injector/providers.pyx":667
* """
* if isinstance(callable, Callable) is False:
* raise Error('{0} can wrap only {1} providers'.format( # <<<<<<<<<<<<<<
* self.__class__, Callable))
* super(Delegate, self).__init__(callable)
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_wrap_only_1_providers, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
/* "dependency_injector/providers.pyx":668
* if isinstance(callable, Callable) is False:
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Callable)) # <<<<<<<<<<<<<<
* super(Delegate, self).__init__(callable)
*
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable)};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable)};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
}
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable));
__pyx_t_7 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(1, 667, __pyx_L1_error)
/* "dependency_injector/providers.pyx":666
* :type provides: object
* """
* if isinstance(callable, Callable) is False: # <<<<<<<<<<<<<<
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Callable))
*/
}
/* "dependency_injector/providers.pyx":669
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Callable))
* super(Delegate, self).__init__(callable) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_10) {
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_callable};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_callable};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_INCREF(__pyx_v_callable);
__Pyx_GIVEREF(__pyx_v_callable);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_callable);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "dependency_injector/providers.pyx":660
* """
*
* def __init__(self, callable): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("dependency_injector.providers.CallableDelegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "dependency_injector/providers.pyx":692
2017-04-06 18:17:06 +03:00
* """
*
* def __init__(self, name, default=None): # <<<<<<<<<<<<<<
2017-04-06 18:17:06 +03:00
* """Initializer.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static int __pyx_pw_19dependency_injector_9providers_13Configuration_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration___init__[] = "Initializer.\n\n :param name: Name of configuration unit.\n :type name: str\n\n :param default: Default values of configuration unit.\n :type default: dict\n ";
#if CYTHON_COMPILING_IN_CPYTHON
2017-04-06 18:17:06 +03:00
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_13Configuration___init__;
#endif
2017-04-06 18:17:06 +03:00
static int __pyx_pw_19dependency_injector_9providers_13Configuration_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 0;
2017-04-06 18:17:06 +03:00
int __pyx_r;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
2017-04-06 18:17:06 +03:00
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2017-04-06 18:17:06 +03:00
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
2017-04-06 18:17:06 +03:00
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 692, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
2017-04-06 18:17:06 +03:00
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
2017-04-06 18:17:06 +03:00
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 692, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Configuration.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration___init__(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_13Configuration___init__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
2017-04-06 18:17:06 +03:00
int __pyx_r;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":701
* :type default: dict
2017-04-06 18:17:06 +03:00
* """
* self.__name = name # <<<<<<<<<<<<<<
* self.__value = None
* self.__children = dict()
*/
2017-07-09 23:29:33 +03:00
if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(1, 701, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __pyx_v_name;
__Pyx_INCREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___name);
__Pyx_DECREF(__pyx_v_self->__pyx___name);
__pyx_v_self->__pyx___name = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":702
2017-04-06 18:17:06 +03:00
* """
* self.__name = name
* self.__value = None # <<<<<<<<<<<<<<
* self.__children = dict()
* if default is not None:
*/
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___value);
__Pyx_DECREF(__pyx_v_self->__pyx___value);
__pyx_v_self->__pyx___value = Py_None;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":703
2017-04-06 18:17:06 +03:00
* self.__name = name
* self.__value = None
* self.__children = dict() # <<<<<<<<<<<<<<
* if default is not None:
* self.update(default)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 703, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___children);
__Pyx_DECREF(__pyx_v_self->__pyx___children);
__pyx_v_self->__pyx___children = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":704
* self.__value = None
* self.__children = dict()
* if default is not None: # <<<<<<<<<<<<<<
* self.update(default)
* super(Configuration, self).__init__()
*/
__pyx_t_2 = (__pyx_v_default != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":705
* self.__children = dict()
* if default is not None:
* self.update(default) # <<<<<<<<<<<<<<
* super(Configuration, self).__init__()
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *)__pyx_v_self->__pyx_base.__pyx_vtab)->update(__pyx_v_self, __pyx_v_default, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":704
2017-04-06 18:17:06 +03:00
* self.__value = None
* self.__children = dict()
* if default is not None: # <<<<<<<<<<<<<<
* self.update(default)
* super(Configuration, self).__init__()
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":706
* if default is not None:
* self.update(default)
2017-04-06 18:17:06 +03:00
* super(Configuration, self).__init__() # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Configuration));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Configuration));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Configuration));
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
2017-04-06 18:17:06 +03:00
}
}
if (__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-04-06 18:17:06 +03:00
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 706, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":692
2017-04-06 18:17:06 +03:00
* """
*
* def __init__(self, name, default=None): # <<<<<<<<<<<<<<
2017-04-06 18:17:06 +03:00
* """Initializer.
*
*/
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":708
2017-04-06 18:17:06 +03:00
* super(Configuration, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":710
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 710, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":711
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":712
2017-04-06 18:17:06 +03:00
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.__name)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":711
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":714
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.__name) # <<<<<<<<<<<<<<
* copied.update(deepcopy(self.__value))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx___name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->__pyx___name};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->__pyx___name};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_v_self->__pyx___name);
__Pyx_GIVEREF(__pyx_v_self->__pyx___name);
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->__pyx___name);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 714, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":715
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.__name)
* copied.update(deepcopy(self.__value)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden:
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __pyx_v_self->__pyx___value;
__Pyx_INCREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_4, 0, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 715, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":717
2017-04-06 18:17:06 +03:00
* copied.update(deepcopy(self.__value))
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2017-07-09 23:29:33 +03:00
else __PYX_ERR(1, 717, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":718
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_10.__pyx_n = 1;
__pyx_t_10.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":717
2017-04-06 18:17:06 +03:00
* copied.update(deepcopy(self.__value))
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":720
2017-04-06 18:17:06 +03:00
* copied.override(deepcopy(overriding_provider, memo))
*
2017-04-06 18:17:06 +03:00
* return copied # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":708
2017-04-06 18:17:06 +03:00
* super(Configuration, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.Configuration.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":722
2017-04-06 18:17:06 +03:00
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_5__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_4__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_13Configuration_4__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_4__str__(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_4__str__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__str__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":727
2017-04-06 18:17:06 +03:00
* :rtype: str
* """
* return represent_provider(provider=self, provides=self.__name) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def __getattr__(self, str name):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __pyx_v_self->__pyx___name;
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 727, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":722
2017-04-06 18:17:06 +03:00
* return copied
*
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":729
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self, provides=self.__name)
*
* def __getattr__(self, str name): # <<<<<<<<<<<<<<
* """Return child configuration provider."""
* cdef Configuration child_provider
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_7__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_6__getattr__[] = "Return child configuration provider.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_13Configuration_6__getattr__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_7__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(1, 729, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_6__getattr__(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), ((PyObject*)__pyx_v_name));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_6__getattr__(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_name) {
struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_child_provider = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_RefNannySetupContext("__getattr__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":734
2017-04-06 18:17:06 +03:00
* cdef object value
*
2017-04-06 18:17:06 +03:00
* if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<<
* raise AttributeError(
* '\'{cls}\' object has no attribute '
*/
2017-04-06 18:17:06 +03:00
if (unlikely(__pyx_v_name == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "startswith");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 734, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyStr_Tailmatch(__pyx_v_name, __pyx_n_s__9, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 734, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
if ((__pyx_t_2 != 0)) {
} else {
__pyx_t_1 = (__pyx_t_2 != 0);
goto __pyx_L4_bool_binop_done;
}
if (unlikely(__pyx_v_name == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "endswith");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 734, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyStr_Tailmatch(__pyx_v_name, __pyx_n_s__9, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 734, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_1 = (__pyx_t_2 != 0);
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":737
2017-04-06 18:17:06 +03:00
* raise AttributeError(
* '\'{cls}\' object has no attribute '
* '\'{attribute_name}\''.format(cls=self.__class__.__name__, # <<<<<<<<<<<<<<
* attribute_name=name))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cls_object_has_no_attribute_att, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cls, __pyx_t_6) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":738
2017-04-06 18:17:06 +03:00
* '\'{cls}\' object has no attribute '
* '\'{attribute_name}\''.format(cls=self.__class__.__name__,
* attribute_name=name)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name)
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_attribute_name, __pyx_v_name) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":737
2017-04-06 18:17:06 +03:00
* raise AttributeError(
* '\'{cls}\' object has no attribute '
* '\'{attribute_name}\''.format(cls=self.__class__.__name__, # <<<<<<<<<<<<<<
* attribute_name=name))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 737, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":735
*
2017-04-06 18:17:06 +03:00
* if name.startswith('__') and name.endswith('__'):
* raise AttributeError( # <<<<<<<<<<<<<<
* '\'{cls}\' object has no attribute '
* '\'{attribute_name}\''.format(cls=self.__class__.__name__,
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 735, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 735, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 735, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":734
2017-04-06 18:17:06 +03:00
* cdef object value
*
2017-04-06 18:17:06 +03:00
* if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<<
* raise AttributeError(
* '\'{cls}\' object has no attribute '
*/
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":740
2017-04-06 18:17:06 +03:00
* attribute_name=name))
*
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* if child_provider is None:
*/
2017-04-06 18:17:06 +03:00
if (unlikely(__pyx_v_self->__pyx___children == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 740, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->__pyx___children, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 740, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
2017-07-09 23:29:33 +03:00
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_19dependency_injector_9providers_Configuration))))) __PYX_ERR(1, 740, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_v_child_provider = ((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_t_6);
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":742
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name)
*
2017-04-06 18:17:06 +03:00
* if child_provider is None: # <<<<<<<<<<<<<<
* child_provider = self.__class__(self._get_child_name(name))
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = (((PyObject *)__pyx_v_child_provider) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":743
*
2017-04-06 18:17:06 +03:00
* if child_provider is None:
* child_provider = self.__class__(self._get_child_name(name)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* if isinstance(self.__value, dict):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 743, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *)__pyx_v_self->__pyx_base.__pyx_vtab)->_get_child_name(__pyx_v_self, __pyx_v_name, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
2017-04-06 18:17:06 +03:00
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
2017-04-06 18:17:06 +03:00
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
2017-04-06 18:17:06 +03:00
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
2017-04-06 18:17:06 +03:00
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 743, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_19dependency_injector_9providers_Configuration))))) __PYX_ERR(1, 743, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF_SET(__pyx_v_child_provider, ((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_t_6));
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":745
2017-04-06 18:17:06 +03:00
* child_provider = self.__class__(self._get_child_name(name))
*
2017-04-06 18:17:06 +03:00
* if isinstance(self.__value, dict): # <<<<<<<<<<<<<<
* child_provider.update(self.__value.get(name))
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_6 = __pyx_v_self->__pyx___value;
__Pyx_INCREF(__pyx_t_6);
__pyx_t_2 = PyDict_Check(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":746
*
2017-04-06 18:17:06 +03:00
* if isinstance(self.__value, dict):
* child_provider.update(self.__value.get(name)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* self.__children[name] = child_provider
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx___value, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_name};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_name};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_name);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *)__pyx_v_child_provider->__pyx_base.__pyx_vtab)->update(__pyx_v_child_provider, __pyx_t_6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 746, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":745
2017-04-06 18:17:06 +03:00
* child_provider = self.__class__(self._get_child_name(name))
*
* if isinstance(self.__value, dict): # <<<<<<<<<<<<<<
* child_provider.update(self.__value.get(name))
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":748
2017-04-06 18:17:06 +03:00
* child_provider.update(self.__value.get(name))
*
* self.__children[name] = child_provider # <<<<<<<<<<<<<<
*
* return child_provider
*/
if (unlikely(__pyx_v_self->__pyx___children == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 748, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
if (unlikely(PyDict_SetItem(__pyx_v_self->__pyx___children, __pyx_v_name, ((PyObject *)__pyx_v_child_provider)) < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":742
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name)
*
* if child_provider is None: # <<<<<<<<<<<<<<
* child_provider = self.__class__(self._get_child_name(name))
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":750
2017-04-06 18:17:06 +03:00
* self.__children[name] = child_provider
*
* return child_provider # <<<<<<<<<<<<<<
*
* cpdef str get_name(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_v_child_provider));
__pyx_r = ((PyObject *)__pyx_v_child_provider);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":729
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self, provides=self.__name)
*
* def __getattr__(self, str name): # <<<<<<<<<<<<<<
* """Return child configuration provider."""
* cdef Configuration child_provider
*/
/* function exit code */
__pyx_L1_error:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("dependency_injector.providers.Configuration.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF((PyObject *)__pyx_v_child_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":752
2017-04-06 18:17:06 +03:00
* return child_provider
*
2017-04-06 18:17:06 +03:00
* cpdef str get_name(self): # <<<<<<<<<<<<<<
* """Name of configuration unit."""
* return self.__name
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_9get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration_get_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("get_name", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_9get_name)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
2017-04-06 18:17:06 +03:00
if (__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 752, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 752, __pyx_L1_error)
}
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 752, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":754
2017-04-06 18:17:06 +03:00
* cpdef str get_name(self):
* """Name of configuration unit."""
* return self.__name # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* cpdef object update(self, value):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_self->__pyx___name);
__pyx_r = __pyx_v_self->__pyx___name;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":752
2017-04-06 18:17:06 +03:00
* return child_provider
*
2017-04-06 18:17:06 +03:00
* cpdef str get_name(self): # <<<<<<<<<<<<<<
* """Name of configuration unit."""
* return self.__name
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_9get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_8get_name[] = "Name of configuration unit.";
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_9get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("get_name (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_8get_name(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_8get_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("get_name", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_13Configuration_get_name(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":756
2017-04-06 18:17:06 +03:00
* return self.__name
*
2017-04-06 18:17:06 +03:00
* cpdef object update(self, value): # <<<<<<<<<<<<<<
* """Set configuration options.
*
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_11update(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration_update(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_child_provider = 0;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
2017-04-06 18:17:06 +03:00
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
__Pyx_RefNannySetupContext("update", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_11update)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_value};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_value};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_value);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":767
2017-04-06 18:17:06 +03:00
* cdef object child_value
*
2017-04-06 18:17:06 +03:00
* self.__value = value # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* if not isinstance(self.__value, dict):
*/
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
__Pyx_GOTREF(__pyx_v_self->__pyx___value);
__Pyx_DECREF(__pyx_v_self->__pyx___value);
__pyx_v_self->__pyx___value = __pyx_v_value;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":769
2017-04-06 18:17:06 +03:00
* self.__value = value
*
2017-04-06 18:17:06 +03:00
* if not isinstance(self.__value, dict): # <<<<<<<<<<<<<<
* return
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __pyx_v_self->__pyx___value;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_6 = PyDict_Check(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":770
*
2017-04-06 18:17:06 +03:00
* if not isinstance(self.__value, dict):
* return # <<<<<<<<<<<<<<
*
* for name in self.__value:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":769
2017-04-06 18:17:06 +03:00
* self.__value = value
*
* if not isinstance(self.__value, dict): # <<<<<<<<<<<<<<
* return
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":772
2017-04-06 18:17:06 +03:00
* return
*
* for name in self.__value: # <<<<<<<<<<<<<<
* child_provider = self.__children.get(name)
*
*/
2017-04-06 18:17:06 +03:00
if (likely(PyList_CheckExact(__pyx_v_self->__pyx___value)) || PyTuple_CheckExact(__pyx_v_self->__pyx___value)) {
__pyx_t_1 = __pyx_v_self->__pyx___value; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->__pyx___value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 772, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
__pyx_t_2 = __pyx_t_9(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2017-07-09 23:29:33 +03:00
else __PYX_ERR(1, 772, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
break;
}
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":773
2017-04-06 18:17:06 +03:00
*
* for name in self.__value:
* child_provider = self.__children.get(name) # <<<<<<<<<<<<<<
*
* if child_provider is None:
*/
if (unlikely(__pyx_v_self->__pyx___children == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 773, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->__pyx___children, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 773, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_19dependency_injector_9providers_Configuration))))) __PYX_ERR(1, 773, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF_SET(__pyx_v_child_provider, ((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_t_2));
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":775
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name)
*
2017-04-06 18:17:06 +03:00
* if child_provider is None: # <<<<<<<<<<<<<<
* continue
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_7 = (((PyObject *)__pyx_v_child_provider) == Py_None);
__pyx_t_6 = (__pyx_t_7 != 0);
if (__pyx_t_6) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":776
*
2017-04-06 18:17:06 +03:00
* if child_provider is None:
* continue # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* child_provider.update(self.__value.get(name))
*/
2017-04-06 18:17:06 +03:00
goto __pyx_L4_continue;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":775
2017-04-06 18:17:06 +03:00
* child_provider = self.__children.get(name)
*
2017-04-06 18:17:06 +03:00
* if child_provider is None: # <<<<<<<<<<<<<<
* continue
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":778
2017-04-06 18:17:06 +03:00
* continue
*
2017-04-06 18:17:06 +03:00
* child_provider.update(self.__value.get(name)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx___value, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_name};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_name};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_name);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration *)__pyx_v_child_provider->__pyx_base.__pyx_vtab)->update(__pyx_v_child_provider, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":772
2017-04-06 18:17:06 +03:00
* return
*
2017-04-06 18:17:06 +03:00
* for name in self.__value: # <<<<<<<<<<<<<<
* child_provider = self.__children.get(name)
*
*/
__pyx_L4_continue:;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":756
2017-04-06 18:17:06 +03:00
* return self.__name
*
* cpdef object update(self, value): # <<<<<<<<<<<<<<
* """Set configuration options.
*
*/
/* function exit code */
2017-04-06 18:17:06 +03:00
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF((PyObject *)__pyx_v_child_provider);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_11update(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_10update[] = "Set configuration options.\n\n :param value: Value of configuration option.\n :type value: object | dict\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_11update(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("update (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_10update(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_10update(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("update", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_13Configuration_update(__pyx_v_self, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":780
2017-04-06 18:17:06 +03:00
* child_provider.update(self.__value.get(name))
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* return self.__value
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_13_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration__provide(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_13_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":782
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* return self.__value # <<<<<<<<<<<<<<
*
* cpdef str _get_child_name(self, str child_name):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___value);
__pyx_r = __pyx_v_self->__pyx___value;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":780
2017-04-06 18:17:06 +03:00
* child_provider.update(self.__value.get(name))
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* return self.__value
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.Configuration._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_13_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13Configuration_12_provide[] = "Return result of provided callable's call.";
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_13_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
2017-04-06 18:17:06 +03:00
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
2017-04-06 18:17:06 +03:00
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
2017-04-06 18:17:06 +03:00
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 780, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 780, __pyx_L3_error)
}
2017-04-06 18:17:06 +03:00
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2017-04-06 18:17:06 +03:00
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
2017-04-06 18:17:06 +03:00
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 780, __pyx_L3_error)
__pyx_L3_error:;
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Configuration._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
2017-04-06 18:17:06 +03:00
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 780, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_12_provide(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_12_provide(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_13Configuration__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Configuration._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":784
2017-04-06 18:17:06 +03:00
* return self.__value
*
2017-04-06 18:17:06 +03:00
* cpdef str _get_child_name(self, str child_name): # <<<<<<<<<<<<<<
* cdef str child_full_name
*
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_15_get_child_name(PyObject *__pyx_v_self, PyObject *__pyx_v_child_name); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_13Configuration__get_child_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_child_name, int __pyx_skip_dispatch) {
PyObject *__pyx_v_child_full_name = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("_get_child_name", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_child_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_15_get_child_name)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_child_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_child_name};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_child_name};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
__Pyx_INCREF(__pyx_v_child_name);
__Pyx_GIVEREF(__pyx_v_child_name);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_child_name);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":787
2017-04-06 18:17:06 +03:00
* cdef str child_full_name
*
2017-04-06 18:17:06 +03:00
* child_full_name = '' # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* if self.__name:
*/
__Pyx_INCREF(__pyx_kp_s__10);
__pyx_v_child_full_name = __pyx_kp_s__10;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":789
2017-04-06 18:17:06 +03:00
* child_full_name = ''
*
2017-04-06 18:17:06 +03:00
* if self.__name: # <<<<<<<<<<<<<<
* child_full_name += self.__name + '.'
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx___name); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 789, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
if (__pyx_t_6) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":790
*
2017-04-06 18:17:06 +03:00
* if self.__name:
* child_full_name += self.__name + '.' # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* child_full_name += child_name
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyNumber_Add(__pyx_v_self->__pyx___name, __pyx_kp_s__7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 790, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_child_full_name, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_child_full_name, ((PyObject*)__pyx_t_2));
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":789
2017-04-06 18:17:06 +03:00
* child_full_name = ''
*
2017-04-06 18:17:06 +03:00
* if self.__name: # <<<<<<<<<<<<<<
* child_full_name += self.__name + '.'
*
*/
}
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":792
2017-04-06 18:17:06 +03:00
* child_full_name += self.__name + '.'
*
* child_full_name += child_name # <<<<<<<<<<<<<<
*
* return child_full_name
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_child_full_name, __pyx_v_child_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 792, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF_SET(__pyx_v_child_full_name, ((PyObject*)__pyx_t_2));
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":794
2017-04-06 18:17:06 +03:00
* child_full_name += child_name
*
2017-04-06 18:17:06 +03:00
* return child_full_name # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_child_full_name);
__pyx_r = __pyx_v_child_full_name;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":784
2017-04-06 18:17:06 +03:00
* return self.__value
*
* cpdef str _get_child_name(self, str child_name): # <<<<<<<<<<<<<<
* cdef str child_full_name
*
*/
/* function exit code */
__pyx_L1_error:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.Configuration._get_child_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_child_full_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_15_get_child_name(PyObject *__pyx_v_self, PyObject *__pyx_v_child_name); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13Configuration_15_get_child_name(PyObject *__pyx_v_self, PyObject *__pyx_v_child_name) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_get_child_name (wrapper)", 0);
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_name), (&PyString_Type), 1, "child_name", 1))) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13Configuration_14_get_child_name(((struct __pyx_obj_19dependency_injector_9providers_Configuration *)__pyx_v_self), ((PyObject*)__pyx_v_child_name));
/* function exit code */
2017-04-06 18:17:06 +03:00
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13Configuration_14_get_child_name(struct __pyx_obj_19dependency_injector_9providers_Configuration *__pyx_v_self, PyObject *__pyx_v_child_name) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_get_child_name", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_13Configuration__get_child_name(__pyx_v_self, __pyx_v_child_name, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Configuration._get_child_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":850
2017-04-06 18:17:06 +03:00
* provided_type = None
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_7Factory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory___init__[] = "Initializer.\n\n :param provides: Provided type.\n :type provides: type\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_7Factory___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_7Factory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 850, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 850, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("dependency_injector.providers.Factory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory___init__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_7Factory___init__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":862
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 862, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 862, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-04-06 18:17:06 +03:00
if (__pyx_t_4) {
} else {
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":863
2017-04-06 18:17:06 +03:00
* """
* if (self.__class__.provided_type and
* not issubclass(provides, self.__class__.provided_type)): # <<<<<<<<<<<<<<
* raise Error('{0} can provide only {1} instances'.format(
* self.__class__, self.__class__.provided_type))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 863, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 863, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":862
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
2017-04-06 18:17:06 +03:00
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":864
2017-04-06 18:17:06 +03:00
* if (self.__class__.provided_type and
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format( # <<<<<<<<<<<<<<
* self.__class__, self.__class__.provided_type))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_7);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":865
2017-04-06 18:17:06 +03:00
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
* self.__class__, self.__class__.provided_type)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* self.__instantiator = Callable(provides, *args, **kwargs)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 865, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
2017-07-09 23:29:33 +03:00
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 865, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
2017-07-09 23:29:33 +03:00
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 865, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
__pyx_t_11 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_11 = 1;
}
2017-04-06 18:17:06 +03:00
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
if (__pyx_t_9) {
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
}
2017-04-06 18:17:06 +03:00
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
__pyx_t_8 = 0;
__pyx_t_10 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 864, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 864, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":862
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":867
2017-04-06 18:17:06 +03:00
* self.__class__, self.__class__.provided_type))
*
2017-04-06 18:17:06 +03:00
* self.__instantiator = Callable(provides, *args, **kwargs) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple()
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 867, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Callable), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___instantiator);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___instantiator));
__pyx_v_self->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":869
2017-04-06 18:17:06 +03:00
* self.__instantiator = Callable(provides, *args, **kwargs)
*
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple() # <<<<<<<<<<<<<<
* self.__attributes_len = 0
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 869, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___attributes);
__Pyx_DECREF(__pyx_v_self->__pyx___attributes);
__pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":870
*
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple()
* self.__attributes_len = 0 # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* super(Factory, self).__init__()
*/
2017-04-06 18:17:06 +03:00
__pyx_v_self->__pyx___attributes_len = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":872
2017-04-06 18:17:06 +03:00
* self.__attributes_len = 0
*
2017-04-06 18:17:06 +03:00
* super(Factory, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 872, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 872, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 872, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_12) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 872, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 872, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":850
2017-04-06 18:17:06 +03:00
* provided_type = None
*
2017-04-06 18:17:06 +03:00
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
2017-04-06 18:17:06 +03:00
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("dependency_injector.providers.Factory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":874
2017-04-06 18:17:06 +03:00
* super(Factory, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":876
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 876, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":877
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":878
2017-04-06 18:17:06 +03:00
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":877
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":880
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":881
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
* *deepcopy(self.args, memo), # <<<<<<<<<<<<<<
* **deepcopy(self.kwargs, memo))
* copied.set_attributes(**deepcopy(self.attributes, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 881, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":880
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":882
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<<
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 882, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 882, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 882, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_t_3 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 882, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
if (likely(PyDict_CheckExact(__pyx_t_3))) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 882, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":880
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 880, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3);
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":883
2017-04-06 18:17:06 +03:00
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
* copied.set_attributes(**deepcopy(self.attributes, memo)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden:
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
if (likely(PyDict_CheckExact(__pyx_t_1))) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 883, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":885
2017-04-06 18:17:06 +03:00
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_10(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2017-07-09 23:29:33 +03:00
else __PYX_ERR(1, 885, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":886
*
2017-04-06 18:17:06 +03:00
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 886, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":885
2017-04-06 18:17:06 +03:00
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
2017-04-06 18:17:06 +03:00
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":888
2017-04-06 18:17:06 +03:00
* copied.override(deepcopy(overriding_provider, memo))
*
2017-04-06 18:17:06 +03:00
* return copied # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":874
2017-04-06 18:17:06 +03:00
* super(Factory, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.Factory.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":890
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_5__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_4__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_7Factory_4__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_5__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_4__str__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_4__str__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__str__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":895
2017-04-06 18:17:06 +03:00
* :rtype: str
* """
* return represent_provider(provider=self, # <<<<<<<<<<<<<<
* provides=self.__instantiator.provides)
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":896
* """
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self,
* provides=self.__instantiator.provides) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 896, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":895
2017-04-06 18:17:06 +03:00
* :rtype: str
* """
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self, # <<<<<<<<<<<<<<
* provides=self.__instantiator.provides)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 895, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":890
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":899
*
* @property
2017-04-06 18:17:06 +03:00
* def cls(self): # <<<<<<<<<<<<<<
* """Return provided type."""
* return self.__instantiator.provides
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_3cls_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_3cls_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_3cls___get__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_3cls___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":901
2017-04-06 18:17:06 +03:00
* def cls(self):
* """Return provided type."""
* return self.__instantiator.provides # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_provides); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 901, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":899
*
* @property
2017-04-06 18:17:06 +03:00
* def cls(self): # <<<<<<<<<<<<<<
* """Return provided type."""
* return self.__instantiator.provides
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.cls.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":904
*
2017-04-06 18:17:06 +03:00
* @property
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* return self.__instantiator.args
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_4args_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_4args___get__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_4args___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":906
2017-04-06 18:17:06 +03:00
* def args(self):
* """Return positional argument injections."""
* return self.__instantiator.args # <<<<<<<<<<<<<<
*
* def add_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 906, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":904
2017-04-06 18:17:06 +03:00
*
* @property
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* return self.__instantiator.args
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Factory.args.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":908
2017-04-06 18:17:06 +03:00
* return self.__instantiator.args
*
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add __init__ postional argument injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_6add_args[] = "Add __init__ postional argument injections.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_6add_args(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_args);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_6add_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("add_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":916
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
* self.__instantiator.add_args(*args) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":917
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_args(*args)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":908
2017-04-06 18:17:06 +03:00
* return self.__instantiator.args
*
2017-04-06 18:17:06 +03:00
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.add_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":919
* return self
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set __init__ postional argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_8set_args[] = "Set __init__ postional argument injections.\n\n Existing __init__ positional argument injections are dropped.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_8set_args(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_args);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_8set_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":929
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_args(*args) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":930
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_args(*args)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def clear_args(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":919
* return self
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.set_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":932
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop __init__ postional argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_10clear_args[] = "Drop __init__ postional argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_args (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_10clear_args(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_10clear_args(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":937
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.clear_args() # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 937, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 937, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":938
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.clear_args()
* return self # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":932
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.clear_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":941
*
* @property
2017-04-06 18:17:06 +03:00
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* return self.__instantiator.kwargs
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_6kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_6kwargs_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_6kwargs___get__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":943
2017-04-06 18:17:06 +03:00
* def kwargs(self):
* """Return keyword argument injections."""
* return self.__instantiator.kwargs # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":941
*
* @property
2017-04-06 18:17:06 +03:00
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* return self.__instantiator.kwargs
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.kwargs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":945
2017-04-06 18:17:06 +03:00
* return self.__instantiator.kwargs
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add __init__ keyword argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_12add_kwargs[] = "Add __init__ keyword argument injections.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2017-04-06 18:17:06 +03:00
__Pyx_RaiseArgtupleInvalid("add_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_kwargs", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
__pyx_v_kwargs = NULL;
}
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_12add_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":953
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_kwargs(**kwargs) # <<<<<<<<<<<<<<
* return self
2017-04-06 18:17:06 +03:00
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 953, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":954
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.add_kwargs(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def set_kwargs(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":945
2017-04-06 18:17:06 +03:00
* return self.__instantiator.kwargs
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add __init__ keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.add_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":956
* return self
*
2017-04-06 18:17:06 +03:00
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set __init__ keyword argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_14set_kwargs[] = "Set __init__ keyword argument injections.\n\n Existing __init__ keyword argument injections are dropped.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2017-04-06 18:17:06 +03:00
__Pyx_RaiseArgtupleInvalid("set_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_kwargs", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
__pyx_v_kwargs = NULL;
}
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_14set_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("set_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":966
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_kwargs(**kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 966, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 966, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":967
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.set_kwargs(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def clear_kwargs(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":956
* return self
*
2017-04-06 18:17:06 +03:00
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set __init__ keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Factory.set_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":969
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop __init__ keyword argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_16clear_kwargs[] = "Drop __init__ keyword argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_kwargs (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_16clear_kwargs(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("clear_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":974
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.clear_kwargs() # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 974, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 974, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 974, __pyx_L1_error)
}
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":975
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.clear_kwargs()
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":969
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop __init__ keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.Factory.clear_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":978
*
2017-04-06 18:17:06 +03:00
* @property
* def attributes(self): # <<<<<<<<<<<<<<
* """Return attribute injections."""
* cdef int index
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_10attributes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_10attributes_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_10attributes___get__(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_10attributes___get__(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
int __pyx_v_index;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_attribute = 0;
PyObject *__pyx_v_attributes = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
int __pyx_t_2;
int __pyx_t_3;
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":984
2017-04-06 18:17:06 +03:00
* cdef dict attributes
*
* attributes = dict() # <<<<<<<<<<<<<<
* for index in range(self.__attributes_len):
* attribute = self.__attributes[index]
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 984, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_attributes = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":985
2017-04-06 18:17:06 +03:00
*
* attributes = dict()
* for index in range(self.__attributes_len): # <<<<<<<<<<<<<<
* attribute = self.__attributes[index]
* attributes[attribute.__name] = attribute.__value
*/
__pyx_t_2 = __pyx_v_self->__pyx___attributes_len;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_index = __pyx_t_3;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":986
2017-04-06 18:17:06 +03:00
* attributes = dict()
* for index in range(self.__attributes_len):
* attribute = self.__attributes[index] # <<<<<<<<<<<<<<
* attributes[attribute.__name] = attribute.__value
* return attributes
*/
if (unlikely(__pyx_v_self->__pyx___attributes == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 986, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx___attributes, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 986, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_19dependency_injector_9providers_NamedInjection))))) __PYX_ERR(1, 986, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF_SET(__pyx_v_attribute, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_1));
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":987
2017-04-06 18:17:06 +03:00
* for index in range(self.__attributes_len):
* attribute = self.__attributes[index]
* attributes[attribute.__name] = attribute.__value # <<<<<<<<<<<<<<
* return attributes
*
*/
__pyx_t_1 = __pyx_v_attribute->__pyx_base.__pyx___value;
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
if (unlikely(PyDict_SetItem(__pyx_v_attributes, __pyx_v_attribute->__pyx___name, __pyx_t_1) < 0)) __PYX_ERR(1, 987, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":988
2017-04-06 18:17:06 +03:00
* attribute = self.__attributes[index]
* attributes[attribute.__name] = attribute.__value
* return attributes # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def add_attributes(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_attributes);
__pyx_r = __pyx_v_attributes;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":978
*
2017-04-06 18:17:06 +03:00
* @property
* def attributes(self): # <<<<<<<<<<<<<<
* """Return attribute injections."""
* cdef int index
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory.attributes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF((PyObject *)__pyx_v_attribute);
__Pyx_XDECREF(__pyx_v_attributes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":990
2017-04-06 18:17:06 +03:00
* return attributes
*
* def add_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Add attribute injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_19add_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_18add_attributes[] = "Add attribute injections.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_19add_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_attributes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("add_attributes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_attributes", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_18add_attributes(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_18add_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
__Pyx_RefNannySetupContext("add_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":998
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
* self.__attributes += parse_named_injections(kwargs) # <<<<<<<<<<<<<<
* self.__attributes_len = len(self.__attributes)
* return self
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 998, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_self->__pyx___attributes, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 998, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___attributes);
__Pyx_DECREF(__pyx_v_self->__pyx___attributes);
__pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":999
2017-04-06 18:17:06 +03:00
* """
* self.__attributes += parse_named_injections(kwargs)
* self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___attributes;
__Pyx_INCREF(__pyx_t_2);
if (unlikely(__pyx_t_2 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 999, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 999, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->__pyx___attributes_len = __pyx_t_3;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1000
2017-04-06 18:17:06 +03:00
* self.__attributes += parse_named_injections(kwargs)
* self.__attributes_len = len(self.__attributes)
* return self # <<<<<<<<<<<<<<
*
* def set_attributes(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":990
2017-04-06 18:17:06 +03:00
* return attributes
*
* def add_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Add attribute injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.Factory.add_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1002
2017-04-06 18:17:06 +03:00
* return self
*
2017-04-06 18:17:06 +03:00
* def set_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Set attribute injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_21set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_20set_attributes[] = "Set attribute injections.\n\n Existing attribute injections are dropped.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_21set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_attributes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("set_attributes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_attributes", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_20set_attributes(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_20set_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("set_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1012
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__attributes = parse_named_injections(kwargs) # <<<<<<<<<<<<<<
* self.__attributes_len = len(self.__attributes)
* return self
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1012, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___attributes);
__Pyx_DECREF(__pyx_v_self->__pyx___attributes);
__pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1013
2017-04-06 18:17:06 +03:00
* """
* self.__attributes = parse_named_injections(kwargs)
* self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_v_self->__pyx___attributes;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1013, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 1013, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___attributes_len = __pyx_t_2;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1014
2017-04-06 18:17:06 +03:00
* self.__attributes = parse_named_injections(kwargs)
* self.__attributes_len = len(self.__attributes)
* return self # <<<<<<<<<<<<<<
*
* def clear_attributes(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1002
2017-04-06 18:17:06 +03:00
* return self
*
* def set_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Set attribute injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Factory.set_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1016
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_attributes(self): # <<<<<<<<<<<<<<
* """Drop attribute injections.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_23clear_attributes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_22clear_attributes[] = "Drop attribute injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_23clear_attributes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear_attributes (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_22clear_attributes(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_22clear_attributes(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
__Pyx_RefNannySetupContext("clear_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1021
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple() # <<<<<<<<<<<<<<
* self.__attributes_len = len(self.__attributes)
* return self
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyTuple_Type)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1021, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___attributes);
__Pyx_DECREF(__pyx_v_self->__pyx___attributes);
__pyx_v_self->__pyx___attributes = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1022
* """
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple()
* self.__attributes_len = len(self.__attributes) # <<<<<<<<<<<<<<
* return self
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __pyx_v_self->__pyx___attributes;
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1022, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 1022, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->__pyx___attributes_len = __pyx_t_2;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1023
2017-04-06 18:17:06 +03:00
* self.__attributes = tuple()
* self.__attributes_len = len(self.__attributes)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1016
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_attributes(self): # <<<<<<<<<<<<<<
* """Drop attribute injections.
*
*/
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Factory.clear_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1025
2017-04-06 18:17:06 +03:00
* return self
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return new instance."""
* return __factory_call(self, args, kwargs)
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_25_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_7Factory__provide(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_25_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1025, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1027
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return new instance."""
* return __factory_call(self, args, kwargs) # <<<<<<<<<<<<<<
*
*
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___factory_call(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1027, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1025
2017-04-06 18:17:06 +03:00
* return self
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return new instance."""
* return __factory_call(self, args, kwargs)
*/
/* function exit code */
__pyx_L1_error:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_25_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_7Factory_24_provide[] = "Return new instance.";
static PyObject *__pyx_pw_19dependency_injector_9providers_7Factory_25_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 1025, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 1025, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1025, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Factory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1025, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_7Factory_24_provide(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
2017-04-06 18:17:06 +03:00
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_7Factory_24_provide(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_7Factory__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1025, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Factory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1061
2017-04-06 18:17:06 +03:00
* """
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_15AbstractFactory___call__[] = "Return provided object.\n\n Callable interface implementation.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_15AbstractFactory___call__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_15AbstractFactory___call__(((struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1066
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1067
2017-04-06 18:17:06 +03:00
* """
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self)) # <<<<<<<<<<<<<<
* return self.__last_overriding._provide(args, kwargs)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_before_cal, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2017-04-06 18:17:06 +03:00
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1067, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1067, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1066
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1068
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def override(self, provider):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding->__pyx_vtab)->_provide(__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1068, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1061
2017-04-06 18:17:06 +03:00
* """
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.AbstractFactory.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1070
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_15AbstractFactory_2override[] = "Override provider with another provider.\n\n :param provider: Overriding provider.\n :type provider: :py:class:`Provider`\n\n :raise: :py:exc:`dependency_injector.errors.Error`\n\n :return: Overriding context.\n :rtype: :py:class:`OverridingContext`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("override (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_15AbstractFactory_2override(((struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *)__pyx_v_self), ((PyObject *)__pyx_v_provider));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("override", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1081
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, Factory): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Factory))
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_provider, __pyx_ptype_19dependency_injector_9providers_Factory);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1082
2017-04-06 18:17:06 +03:00
* """
* if not isinstance(provider, Factory):
* raise Error('{0} must be overridden only by ' # <<<<<<<<<<<<<<
* '{1} providers'.format(self, Factory))
* return super(AbstractFactory, self).override(provider)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1083
2017-04-06 18:17:06 +03:00
* if not isinstance(provider, Factory):
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Factory)) # <<<<<<<<<<<<<<
* return super(AbstractFactory, self).override(provider)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_only_by_1, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1083, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1083, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1083, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1083, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1083, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1082, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1082, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1081
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, Factory): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Factory))
*/
2017-04-06 18:17:06 +03:00
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1084
2017-04-06 18:17:06 +03:00
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, Factory))
* return super(AbstractFactory, self).override(provider) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractFactory));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractFactory));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractFactory));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_9) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_provider); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else {
2017-04-06 18:17:06 +03:00
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_provider);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1084, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1070
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
2017-04-06 18:17:06 +03:00
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
2017-04-06 18:17:06 +03:00
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("dependency_injector.providers.AbstractFactory.override", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1086
2017-04-06 18:17:06 +03:00
* return super(AbstractFactory, self).override(provider)
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic '
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_15AbstractFactory__provide(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_15AbstractFactory_5_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2017-04-06 18:17:06 +03:00
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1088
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic ' # <<<<<<<<<<<<<<
* 'to overriding provider')
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1088, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1088, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1086
2017-04-06 18:17:06 +03:00
* return super(AbstractFactory, self).override(provider)
*
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic '
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.AbstractFactory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_15AbstractFactory_4_provide[] = "Return result of provided callable's call.";
static PyObject *__pyx_pw_19dependency_injector_9providers_15AbstractFactory_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 1086, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 1086, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1086, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.AbstractFactory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
2017-04-06 18:17:06 +03:00
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1086, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1086, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_15AbstractFactory_4_provide(((struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_15AbstractFactory_4_provide(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_15AbstractFactory__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.AbstractFactory._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1102
2017-07-09 23:13:10 +03:00
* """
*
* def __init__(self, factory): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_15FactoryDelegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_15FactoryDelegate___init__[] = "Initializer.\n\n :param provides: Value that have to be provided.\n :type provides: object\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_15FactoryDelegate___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_15FactoryDelegate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_factory = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_factory,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_factory)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 1102, __pyx_L3_error)
2017-07-09 23:13:10 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_factory = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1102, __pyx_L3_error)
2017-07-09 23:13:10 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.FactoryDelegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_15FactoryDelegate___init__(((struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate *)__pyx_v_self), __pyx_v_factory);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_15FactoryDelegate___init__(struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate *__pyx_v_self, PyObject *__pyx_v_factory) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1108
2017-07-09 23:13:10 +03:00
* :type provides: object
* """
* if isinstance(factory, Factory) is False: # <<<<<<<<<<<<<<
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Factory))
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_factory, __pyx_ptype_19dependency_injector_9providers_Factory);
__pyx_t_2 = ((__pyx_t_1 == 0) != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1109
2017-07-09 23:13:10 +03:00
* """
* if isinstance(factory, Factory) is False:
* raise Error('{0} can wrap only {1} providers'.format( # <<<<<<<<<<<<<<
* self.__class__, Factory))
* super(Delegate, self).__init__(factory)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_wrap_only_1_providers, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_6);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1110
2017-07-09 23:13:10 +03:00
* if isinstance(factory, Factory) is False:
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Factory)) # <<<<<<<<<<<<<<
* super(Delegate, self).__init__(factory)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1110, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_8) {
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
}
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory));
__pyx_t_7 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1109, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1108
2017-07-09 23:13:10 +03:00
* :type provides: object
* """
* if isinstance(factory, Factory) is False: # <<<<<<<<<<<<<<
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Factory))
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1111
2017-07-09 23:13:10 +03:00
* raise Error('{0} can wrap only {1} providers'.format(
* self.__class__, Factory))
* super(Delegate, self).__init__(factory) # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Delegate));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_10) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_factory); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_factory};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_factory};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
__Pyx_INCREF(__pyx_v_factory);
__Pyx_GIVEREF(__pyx_v_factory);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_factory);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1111, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1102
2017-07-09 23:13:10 +03:00
* """
*
* def __init__(self, factory): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("dependency_injector.providers.FactoryDelegate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1119
2017-04-06 18:17:06 +03:00
* provided_type = None
*
2017-04-06 18:17:06 +03:00
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static int __pyx_pw_19dependency_injector_9providers_13BaseSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton___init__[] = "Initializer.\n\n :param provides: Provided type.\n :type provides: type\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_13BaseSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 1119, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1119, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton___init__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static int __pyx_pf_19dependency_injector_9providers_13BaseSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1131
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
2017-04-06 18:17:06 +03:00
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1131, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 1131, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1132
* """
2017-04-06 18:17:06 +03:00
* if (self.__class__.provided_type and
* not issubclass(provides, self.__class__.provided_type)): # <<<<<<<<<<<<<<
* raise Error('{0} can provide only {1} instances'.format(
* self.__class__, self.__class__.provided_type))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1132, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1132, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyObject_IsSubclass(__pyx_v_provides, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1132, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1131
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
2017-04-06 18:17:06 +03:00
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1133
2017-04-06 18:17:06 +03:00
* if (self.__class__.provided_type and
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format( # <<<<<<<<<<<<<<
* self.__class__, self.__class__.provided_type))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_can_provide_only_1_instances, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_7);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1134
2017-04-06 18:17:06 +03:00
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
* self.__class__, self.__class__.provided_type)) # <<<<<<<<<<<<<<
*
* self.__instantiator = Factory(provides, *args, **kwargs)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1134, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
2017-07-09 23:29:33 +03:00
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1134, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
2017-07-09 23:29:33 +03:00
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_provided_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1134, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
__pyx_t_11 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
__pyx_t_11 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
if (__pyx_t_9) {
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
}
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
__pyx_t_8 = 0;
__pyx_t_10 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6);
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1133, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1133, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1131
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
2017-04-06 18:17:06 +03:00
* if (self.__class__.provided_type and # <<<<<<<<<<<<<<
* not issubclass(provides, self.__class__.provided_type)):
* raise Error('{0} can provide only {1} instances'.format(
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1136
2017-04-06 18:17:06 +03:00
* self.__class__, self.__class__.provided_type))
*
* self.__instantiator = Factory(provides, *args, **kwargs) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* super(BaseSingleton, self).__init__()
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1136, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory), __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___instantiator);
__Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx___instantiator));
__pyx_v_self->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1138
2017-04-06 18:17:06 +03:00
* self.__instantiator = Factory(provides, *args, **kwargs)
*
2017-04-06 18:17:06 +03:00
* super(BaseSingleton, self).__init__() # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1138, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
2017-04-06 18:17:06 +03:00
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1138, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1138, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_12 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_12)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_12) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1138, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1138, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1119
2017-04-06 18:17:06 +03:00
* provided_type = None
*
2017-04-06 18:17:06 +03:00
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
2017-04-06 18:17:06 +03:00
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1140
2017-04-06 18:17:06 +03:00
* super(BaseSingleton, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_2__str__[] = "Return string representation of provider.\n\n :rtype: str\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton_2__str__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_2__str__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_2__str__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__str__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1145
2017-04-06 18:17:06 +03:00
* :rtype: str
* """
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self, # <<<<<<<<<<<<<<
* provides=self.__instantiator.cls)
*
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1146
* """
2017-04-06 18:17:06 +03:00
* return represent_provider(provider=self,
* provides=self.__instantiator.cls) # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1146, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1145
2017-04-06 18:17:06 +03:00
* :rtype: str
* """
* return represent_provider(provider=self, # <<<<<<<<<<<<<<
* provides=self.__instantiator.cls)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers_represent_provider(((PyObject *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1145, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1140
2017-04-06 18:17:06 +03:00
* super(BaseSingleton, self).__init__()
*
2017-04-06 18:17:06 +03:00
* def __str__(self): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1148
2017-04-06 18:17:06 +03:00
* provides=self.__instantiator.cls)
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_5__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_4__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_5__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_4__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_4__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_v_overriding_provider = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1150
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1150, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1151
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
2017-04-06 18:17:06 +03:00
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1152
2017-04-06 18:17:06 +03:00
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1151
2017-04-06 18:17:06 +03:00
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1154
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cls); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1154, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1155
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
* *deepcopy(self.args, memo), # <<<<<<<<<<<<<<
* **deepcopy(self.kwargs, memo))
* copied.set_attributes(**deepcopy(self.attributes, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1155, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1155, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_2, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1155, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1154
2017-04-06 18:17:06 +03:00
* return copied
*
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1154, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1154, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1156
2017-04-06 18:17:06 +03:00
* copied = self.__class__(self.cls,
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo)) # <<<<<<<<<<<<<<
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1156, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1156, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1156, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_t_3 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1156, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
if (likely(PyDict_CheckExact(__pyx_t_3))) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyDict_Copy(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1156, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1154, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1154
2017-04-06 18:17:06 +03:00
* return copied
*
* copied = self.__class__(self.cls, # <<<<<<<<<<<<<<
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1154, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_copied, __pyx_t_3);
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1157
2017-04-06 18:17:06 +03:00
* *deepcopy(self.args, memo),
* **deepcopy(self.kwargs, memo))
* copied.set_attributes(**deepcopy(self.attributes, memo)) # <<<<<<<<<<<<<<
*
* for overriding_provider in self.overridden:
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_4, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
if (likely(PyDict_CheckExact(__pyx_t_1))) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyDict_Copy(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1157, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1159
2017-04-06 18:17:06 +03:00
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_overridden); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-04-06 18:17:06 +03:00
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_10(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2017-07-09 23:29:33 +03:00
else __PYX_ERR(1, 1159, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF_SET(__pyx_v_overriding_provider, __pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1160
2017-04-06 18:17:06 +03:00
*
* for overriding_provider in self.overridden:
* copied.override(deepcopy(overriding_provider, memo)) # <<<<<<<<<<<<<<
*
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copied, __pyx_n_s_override); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_overriding_provider, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1160, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1159
2017-04-06 18:17:06 +03:00
* copied.set_attributes(**deepcopy(self.attributes, memo))
*
* for overriding_provider in self.overridden: # <<<<<<<<<<<<<<
* copied.override(deepcopy(overriding_provider, memo))
*
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1162
2017-04-06 18:17:06 +03:00
* copied.override(deepcopy(overriding_provider, memo))
*
2017-04-06 18:17:06 +03:00
* return copied # <<<<<<<<<<<<<<
*
* @property
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1148
2017-04-06 18:17:06 +03:00
* provides=self.__instantiator.cls)
*
2017-04-06 18:17:06 +03:00
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XDECREF(__pyx_v_overriding_provider);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1165
*
2017-04-06 18:17:06 +03:00
* @property
* def cls(self): # <<<<<<<<<<<<<<
* """Return provided type."""
* return self.__instantiator.cls
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3cls_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3cls_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_3cls___get__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_3cls___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1167
2017-04-06 18:17:06 +03:00
* def cls(self):
* """Return provided type."""
* return self.__instantiator.cls # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1167, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1165
*
2017-04-06 18:17:06 +03:00
* @property
* def cls(self): # <<<<<<<<<<<<<<
* """Return provided type."""
* return self.__instantiator.cls
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.cls.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1170
*
* @property
2017-04-06 18:17:06 +03:00
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* return self.__instantiator.args
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_4args_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_4args___get__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_4args___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1172
2017-04-06 18:17:06 +03:00
* def args(self):
* """Return positional argument injections."""
* return self.__instantiator.args # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def add_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1170
*
* @property
2017-04-06 18:17:06 +03:00
* def args(self): # <<<<<<<<<<<<<<
* """Return positional argument injections."""
* return self.__instantiator.args
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.args.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1174
2017-04-06 18:17:06 +03:00
* return self.__instantiator.args
*
2017-04-06 18:17:06 +03:00
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add __init__ postional argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_6add_args[] = "Add __init__ postional argument injections.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_7add_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_6add_args(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_args);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_6add_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1182
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_args(*args) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1183
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_args(*args)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1174
2017-04-06 18:17:06 +03:00
* return self.__instantiator.args
*
2017-04-06 18:17:06 +03:00
* def add_args(self, *args): # <<<<<<<<<<<<<<
* """Add __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.add_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1185
* return self
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set __init__ postional argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_8set_args[] = "Set __init__ postional argument injections.\n\n Existing __init__ positional argument injections are dropped.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_9set_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_args (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_args", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_8set_args(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_args);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_args);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_8set_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1195
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_args(*args) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1196
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_args(*args)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def clear_args(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1185
* return self
*
2017-04-06 18:17:06 +03:00
* def set_args(self, *args): # <<<<<<<<<<<<<<
* """Set __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.set_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1198
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop __init__ postional argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_10clear_args[] = "Drop __init__ postional argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_11clear_args(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_args (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_10clear_args(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_10clear_args(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1203
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.clear_args() # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1203, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1203, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1204
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.clear_args()
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1198
* return self
*
2017-04-06 18:17:06 +03:00
* def clear_args(self): # <<<<<<<<<<<<<<
* """Drop __init__ postional argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.clear_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1207
*
2017-04-06 18:17:06 +03:00
* @property
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* return self.__instantiator.kwargs
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_6kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_6kwargs_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_6kwargs___get__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_6kwargs___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1209
2017-04-06 18:17:06 +03:00
* def kwargs(self):
* """Return keyword argument injections."""
* return self.__instantiator.kwargs # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1207
*
2017-04-06 18:17:06 +03:00
* @property
* def kwargs(self): # <<<<<<<<<<<<<<
* """Return keyword argument injections."""
* return self.__instantiator.kwargs
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.kwargs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
2017-04-06 18:17:06 +03:00
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1211
2017-04-06 18:17:06 +03:00
* return self.__instantiator.kwargs
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add __init__ keyword argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_12add_kwargs[] = "Add __init__ keyword argument injections.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_13add_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("add_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_kwargs", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
2017-04-06 18:17:06 +03:00
__pyx_v_kwargs = NULL;
}
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_12add_kwargs(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_12add_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1219
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_kwargs(**kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1219, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1219, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1220
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_kwargs(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def set_kwargs(self, **kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
2017-04-06 18:17:06 +03:00
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1211
2017-04-06 18:17:06 +03:00
* return self.__instantiator.kwargs
*
2017-04-06 18:17:06 +03:00
* def add_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Add __init__ keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.add_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1222
2017-04-06 18:17:06 +03:00
* return self
*
2017-04-06 18:17:06 +03:00
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set __init__ keyword argument injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_14set_kwargs[] = "Set __init__ keyword argument injections.\n\n Existing __init__ keyword argument injections are dropped.\n\n :param kwargs: Dictionary of injections.\n :type kwargs: dict\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_15set_kwargs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_kwargs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("set_kwargs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_kwargs", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
__pyx_v_kwargs = NULL;
}
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_14set_kwargs(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_14set_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("set_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1232
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_kwargs(**kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1232, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1232, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1233
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.set_kwargs(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def clear_kwargs(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1222
2017-04-06 18:17:06 +03:00
* return self
*
* def set_kwargs(self, **kwargs): # <<<<<<<<<<<<<<
* """Set __init__ keyword argument injections.
*
*/
/* function exit code */
2017-04-06 18:17:06 +03:00
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.set_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1235
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop __init__ keyword argument injections.
*
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_16clear_kwargs[] = "Drop __init__ keyword argument injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_17clear_kwargs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear_kwargs (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_16clear_kwargs(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_16clear_kwargs(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_kwargs", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1240
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
* self.__instantiator.clear_kwargs() # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1240, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1240, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1240, __pyx_L1_error)
}
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1241
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.clear_kwargs()
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* @property
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1235
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_kwargs(self): # <<<<<<<<<<<<<<
* """Drop __init__ keyword argument injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.clear_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1244
2017-04-06 18:17:06 +03:00
*
* @property
* def attributes(self): # <<<<<<<<<<<<<<
* """Return attribute injections."""
* return self.__instantiator.attributes
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_10attributes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_10attributes_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_10attributes___get__(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_10attributes___get__(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("__get__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1246
2017-04-06 18:17:06 +03:00
* def attributes(self):
* """Return attribute injections."""
* return self.__instantiator.attributes # <<<<<<<<<<<<<<
*
* def add_attributes(self, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1244
2017-04-06 18:17:06 +03:00
*
* @property
* def attributes(self): # <<<<<<<<<<<<<<
* """Return attribute injections."""
* return self.__instantiator.attributes
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.attributes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1248
2017-04-06 18:17:06 +03:00
* return self.__instantiator.attributes
*
2017-04-06 18:17:06 +03:00
* def add_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Add attribute injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_19add_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_18add_attributes[] = "Add attribute injections.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_19add_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
2017-04-06 18:17:06 +03:00
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_attributes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("add_attributes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add_attributes", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
2017-04-06 18:17:06 +03:00
__pyx_v_kwargs = NULL;
}
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_18add_attributes(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_18add_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("add_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1256
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.add_attributes(**kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_add_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1257
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.add_attributes(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def set_attributes(self, **kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
2017-04-06 18:17:06 +03:00
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1248
2017-04-06 18:17:06 +03:00
* return self.__instantiator.attributes
*
2017-04-06 18:17:06 +03:00
* def add_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Add attribute injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.add_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
2017-04-06 18:17:06 +03:00
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1259
2017-04-06 18:17:06 +03:00
* return self
*
2017-04-06 18:17:06 +03:00
* def set_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Set attribute injections.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_21set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_20set_attributes[] = "Set attribute injections.\n\n Existing attribute injections are dropped.\n\n :param args: Tuple of injections.\n :type args: tuple\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_21set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("set_attributes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("set_attributes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "set_attributes", 1))) return NULL;
if (__pyx_kwds) {
__pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
} else {
__pyx_v_kwargs = NULL;
}
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_20set_attributes(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self), __pyx_v_kwargs);
/* function exit code */
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_20set_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("set_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1269
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
2017-04-06 18:17:06 +03:00
* self.__instantiator.set_attributes(**kwargs) # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_set_attributes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1269, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1269, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1270
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.set_attributes(**kwargs)
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def clear_attributes(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1259
2017-04-06 18:17:06 +03:00
* return self
*
* def set_attributes(self, **kwargs): # <<<<<<<<<<<<<<
* """Set attribute injections.
*
*/
/* function exit code */
2017-04-06 18:17:06 +03:00
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.set_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1272
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_attributes(self): # <<<<<<<<<<<<<<
* """Drop attribute injections.
*
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_23clear_attributes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_22clear_attributes[] = "Drop attribute injections.\n\n :return: Reference ``self``\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_23clear_attributes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear_attributes (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_22clear_attributes(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_22clear_attributes(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("clear_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1277
2017-04-06 18:17:06 +03:00
* :return: Reference ``self``
* """
* self.__instantiator.clear_attributes() # <<<<<<<<<<<<<<
* return self
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx___instantiator), __pyx_n_s_clear_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1277, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
2017-04-06 18:17:06 +03:00
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1277, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1277, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1278
2017-04-06 18:17:06 +03:00
* """
* self.__instantiator.clear_attributes()
* return self # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def reset(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1272
2017-04-06 18:17:06 +03:00
* return self
*
* def clear_attributes(self): # <<<<<<<<<<<<<<
* """Drop attribute injections.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.clear_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1280
2017-04-06 18:17:06 +03:00
* return self
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_25reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_13BaseSingleton_24reset[] = "Reset cached instance, if any.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_13BaseSingleton_25reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_13BaseSingleton_24reset(((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_13BaseSingleton_24reset(CYTHON_UNUSED struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("reset", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1285
2017-04-06 18:17:06 +03:00
* :rtype: None
* """
* raise NotImplementedError() # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1285, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1280
2017-04-06 18:17:06 +03:00
* return self
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.BaseSingleton.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1319
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static int __pyx_pw_19dependency_injector_9providers_9Singleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_9Singleton___init__[] = "Initializer.\n\n :param provides: Provided type.\n :type provides: type\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
2017-04-06 18:17:06 +03:00
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_9Singleton___init__;
#endif
2017-04-06 18:17:06 +03:00
static int __pyx_pw_19dependency_injector_9providers_9Singleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 1319, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1319, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Singleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_9Singleton___init__(((struct __pyx_obj_19dependency_injector_9providers_Singleton *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static int __pyx_pf_19dependency_injector_9providers_9Singleton___init__(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1331
* :type kwargs: dict[str, object]
* """
2017-04-06 18:17:06 +03:00
* self.__storage = None # <<<<<<<<<<<<<<
* super(Singleton, self).__init__(provides, *args, **kwargs)
*
*/
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
2017-04-06 18:17:06 +03:00
__pyx_v_self->__pyx___storage = Py_None;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1332
* """
2017-04-06 18:17:06 +03:00
* self.__storage = None
* super(Singleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Singleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_Singleton));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_Singleton));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1332, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1332, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
2017-04-06 18:17:06 +03:00
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_provides);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1332, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1319
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
2017-04-06 18:17:06 +03:00
__Pyx_AddTraceback("dependency_injector.providers.Singleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1334
2017-04-06 18:17:06 +03:00
* super(Singleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_9Singleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_9Singleton_2reset[] = "Reset cached instance, if any.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_9Singleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_9Singleton_2reset(((struct __pyx_obj_19dependency_injector_9providers_Singleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_9Singleton_2reset(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1339
* :rtype: None
* """
2017-04-06 18:17:06 +03:00
* self.__storage = None # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = Py_None;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1334
2017-04-06 18:17:06 +03:00
* super(Singleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1341
2017-04-06 18:17:06 +03:00
* self.__storage = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
*/
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_9Singleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_9Singleton__provide(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
2017-04-06 18:17:06 +03:00
int __pyx_t_7;
int __pyx_t_8;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_9Singleton_5_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1343
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return single instance."""
* if self.__storage is None: # <<<<<<<<<<<<<<
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
*/
2017-04-06 18:17:06 +03:00
__pyx_t_7 = (__pyx_v_self->__pyx___storage == Py_None);
__pyx_t_8 = (__pyx_t_7 != 0);
if (__pyx_t_8) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1344
2017-04-06 18:17:06 +03:00
* """Return single instance."""
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator, # <<<<<<<<<<<<<<
* args, kwargs)
* return self.__storage
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator);
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1345
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs) # <<<<<<<<<<<<<<
* return self.__storage
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___factory_call(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1344, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1344
2017-04-06 18:17:06 +03:00
* """Return single instance."""
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator, # <<<<<<<<<<<<<<
* args, kwargs)
* return self.__storage
*/
2017-04-06 18:17:06 +03:00
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = __pyx_t_2;
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1343
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return single instance."""
* if self.__storage is None: # <<<<<<<<<<<<<<
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1346
2017-04-06 18:17:06 +03:00
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
* return self.__storage # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___storage);
__pyx_r = __pyx_v_self->__pyx___storage;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1341
2017-04-06 18:17:06 +03:00
* self.__storage = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
* if self.__storage is None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.Singleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_9Singleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_9Singleton_4_provide[] = "Return single instance.";
static PyObject *__pyx_pw_19dependency_injector_9providers_9Singleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 1341, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 1341, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1341, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.Singleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1341, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1341, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_9Singleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_Singleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_9Singleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_Singleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_9Singleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1341, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.Singleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1379
* """
2017-04-06 18:17:06 +03:00
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton___init__[] = "Initializer.\n\n :param provides: Provided type.\n :type provides: type\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_19ThreadSafeSingleton___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 1379, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1379, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton___init__(((struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1391
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* self.__storage = None # <<<<<<<<<<<<<<
* self.__storage_lock = self.__class__.storage_lock
2017-04-06 18:17:06 +03:00
* super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs)
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = Py_None;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1392
2017-04-06 18:17:06 +03:00
* """
* self.__storage = None
* self.__storage_lock = self.__class__.storage_lock # <<<<<<<<<<<<<<
2017-04-06 18:17:06 +03:00
* super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1392, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_storage_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage_lock);
__Pyx_DECREF(__pyx_v_self->__pyx___storage_lock);
__pyx_v_self->__pyx___storage_lock = __pyx_t_2;
__pyx_t_2 = 0;
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1393
2017-04-06 18:17:06 +03:00
* self.__storage = None
* self.__storage_lock = self.__class__.storage_lock
2017-04-06 18:17:06 +03:00
* super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton));
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1393, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1393, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_provides);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1393, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1379
* """
2017-04-06 18:17:06 +03:00
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1395
2017-04-06 18:17:06 +03:00
* super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton_2reset[] = "Reset cached instance, if any.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_2reset(((struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_2reset(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1400
2017-04-06 18:17:06 +03:00
* :rtype: None
* """
* self.__storage = None # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = Py_None;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1395
2017-04-06 18:17:06 +03:00
* super(ThreadSafeSingleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1402
2017-04-06 18:17:06 +03:00
* self.__storage = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_19ThreadSafeSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
int __pyx_t_11;
int __pyx_t_12;
PyObject *__pyx_t_13 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_5_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1404
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return single instance."""
* with self.__storage_lock: # <<<<<<<<<<<<<<
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator,
*/
/*with:*/ {
2017-07-09 23:29:33 +03:00
__pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___storage_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1404, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_7);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->__pyx___storage_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1404, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1404, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1404, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
/*try:*/ {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1405
2017-04-06 18:17:06 +03:00
* """Return single instance."""
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
* if self.__storage is None: # <<<<<<<<<<<<<<
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
*/
__pyx_t_11 = (__pyx_v_self->__pyx___storage == Py_None);
__pyx_t_12 = (__pyx_t_11 != 0);
if (__pyx_t_12) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1406
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator, # <<<<<<<<<<<<<<
* args, kwargs)
* return self.__storage
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator);
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1407
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs) # <<<<<<<<<<<<<<
* return self.__storage
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___factory_call(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1406, __pyx_L7_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1406
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator, # <<<<<<<<<<<<<<
* args, kwargs)
* return self.__storage
*/
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = __pyx_t_2;
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1405
2017-04-06 18:17:06 +03:00
* """Return single instance."""
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
* if self.__storage is None: # <<<<<<<<<<<<<<
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1404
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return single instance."""
* with self.__storage_lock: # <<<<<<<<<<<<<<
2017-04-06 18:17:06 +03:00
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator,
*/
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L14_try_end;
__pyx_L7_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
/*except:*/ {
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
2017-07-09 23:29:33 +03:00
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(1, 1404, __pyx_L9_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1404, __pyx_L9_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 1404, __pyx_L9_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2017-07-09 23:29:33 +03:00
if (__pyx_t_12 < 0) __PYX_ERR(1, 1404, __pyx_L9_except_error)
2017-04-06 18:17:06 +03:00
__pyx_t_11 = ((!(__pyx_t_12 != 0)) != 0);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
__pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1404, __pyx_L9_except_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_exception_handled;
}
__pyx_L9_except_error:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
goto __pyx_L1_error;
__pyx_L8_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_L14_try_end:;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_7) {
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__12, NULL);
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2017-07-09 23:29:33 +03:00
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1404, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
goto __pyx_L6;
}
__pyx_L6:;
}
goto __pyx_L19;
__pyx_L3_error:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L1_error;
__pyx_L19:;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1408
2017-04-06 18:17:06 +03:00
* self.__storage = __factory_call(self.__instantiator,
* args, kwargs)
* return self.__storage # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___storage);
__pyx_r = __pyx_v_self->__pyx___storage;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1402
2017-04-06 18:17:06 +03:00
* self.__storage = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
* with self.__storage_lock:
2017-04-06 18:17:06 +03:00
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton_4_provide[] = "Return single instance.";
static PyObject *__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 1402, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 1402, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1402, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1402, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_19ThreadSafeSingleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_19ThreadSafeSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1402, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.ThreadSafeSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1450
2017-04-06 18:17:06 +03:00
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton___init__[] = "Initializer.\n\n :param provides: Provided type.\n :type provides: type\n\n :param args: Tuple of positional argument injections.\n :type args: tuple[object]\n\n :param kwargs: Dictionary of context keyword argument injections.\n :type kwargs: dict[str, object]\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_20ThreadLocalSingleton___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return -1;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provides,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(1, 1450, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_provides = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1450, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton___init__(((struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)__pyx_v_self), __pyx_v_provides, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton___init__(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_provides, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1462
2017-04-06 18:17:06 +03:00
* :type kwargs: dict[str, object]
* """
* self.__storage = threading.local() # <<<<<<<<<<<<<<
* super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1462, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1462, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1462, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1462, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->__pyx___storage);
__Pyx_DECREF(__pyx_v_self->__pyx___storage);
__pyx_v_self->__pyx___storage = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1463
2017-04-06 18:17:06 +03:00
* """
* self.__storage = threading.local()
* super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_provides);
__Pyx_GIVEREF(__pyx_v_provides);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_provides);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1463, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1450
2017-04-06 18:17:06 +03:00
* """
*
* def __init__(self, provides, *args, **kwargs): # <<<<<<<<<<<<<<
* """Initializer.
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1465
2017-04-06 18:17:06 +03:00
* super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton_2reset[] = "Reset cached instance, if any.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_3reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_2reset(((struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_2reset(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1470
2017-04-06 18:17:06 +03:00
* :rtype: None
* """
* self.__storage.instance = None # <<<<<<<<<<<<<<
*
* cpdef object _provide(self, tuple args, dict kwargs):
*/
2017-07-09 23:29:33 +03:00
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, Py_None) < 0) __PYX_ERR(1, 1470, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1465
2017-04-06 18:17:06 +03:00
* super(ThreadLocalSingleton, self).__init__(provides, *args, **kwargs)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1472
2017-04-06 18:17:06 +03:00
* self.__storage.instance = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
* cdef object instance
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_20ThreadLocalSingleton__provide(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, int __pyx_skip_dispatch) {
PyObject *__pyx_v_instance = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_provide); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_5_provide)) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_args, __pyx_v_kwargs};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kwargs);
__Pyx_GIVEREF(__pyx_v_kwargs);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kwargs);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1476
2017-04-06 18:17:06 +03:00
* cdef object instance
*
* try: # <<<<<<<<<<<<<<
* instance = self.__storage.instance
* except AttributeError:
*/
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
/*try:*/ {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1477
2017-04-06 18:17:06 +03:00
*
* try:
* instance = self.__storage.instance # <<<<<<<<<<<<<<
* except AttributeError:
* instance = __factory_call(self.__instantiator, args, kwargs)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1477, __pyx_L6_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_instance = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1476
2017-04-06 18:17:06 +03:00
* cdef object instance
*
* try: # <<<<<<<<<<<<<<
* instance = self.__storage.instance
* except AttributeError:
*/
}
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L13_try_end;
__pyx_L6_error:;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1478
2017-04-06 18:17:06 +03:00
* try:
* instance = self.__storage.instance
* except AttributeError: # <<<<<<<<<<<<<<
* instance = __factory_call(self.__instantiator, args, kwargs)
* self.__storage.instance = instance
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_5) {
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
2017-07-09 23:29:33 +03:00
if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 1478, __pyx_L8_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1479
* instance = self.__storage.instance
* except AttributeError:
* instance = __factory_call(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<<
* self.__storage.instance = instance
* finally:
*/
2017-04-06 18:17:06 +03:00
__pyx_t_6 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx___instantiator);
__Pyx_INCREF(__pyx_t_6);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers___factory_call(((struct __pyx_obj_19dependency_injector_9providers_Factory *)__pyx_t_6), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1479, __pyx_L8_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1480
2017-04-06 18:17:06 +03:00
* except AttributeError:
* instance = __factory_call(self.__instantiator, args, kwargs)
* self.__storage.instance = instance # <<<<<<<<<<<<<<
* finally:
* return instance
*/
2017-07-09 23:29:33 +03:00
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->__pyx___storage, __pyx_n_s_instance, __pyx_v_instance) < 0) __PYX_ERR(1, 1480, __pyx_L8_except_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L7_exception_handled;
}
goto __pyx_L8_except_error;
__pyx_L8_except_error:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1476
2017-04-06 18:17:06 +03:00
* cdef object instance
*
* try: # <<<<<<<<<<<<<<
* instance = self.__storage.instance
* except AttributeError:
*/
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
goto __pyx_L4_error;
__pyx_L7_exception_handled:;
__Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
__pyx_L13_try_end:;
}
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1482
2017-04-06 18:17:06 +03:00
* self.__storage.instance = instance
* finally:
* return instance # <<<<<<<<<<<<<<
*
*
*/
/*finally:*/ {
/*normal exit:*/{
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_instance);
__pyx_r = __pyx_v_instance;
goto __pyx_L0;
}
/*exception exit:*/{
__Pyx_PyThreadState_declare
__pyx_L4_error:;
__pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
__Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
{
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
if (unlikely(!__pyx_v_instance)) { __Pyx_RaiseUnboundLocalError("instance"); __PYX_ERR(1, 1482, __pyx_L17_error) }
2017-04-06 18:17:06 +03:00
__Pyx_INCREF(__pyx_v_instance);
__pyx_r = __pyx_v_instance;
goto __pyx_L16_return;
}
__pyx_L16_return:;
__Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
}
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
goto __pyx_L0;
__pyx_L17_error:;
__Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
}
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
goto __pyx_L1_error;
}
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1472
2017-04-06 18:17:06 +03:00
* self.__storage.instance = None
*
* cpdef object _provide(self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* """Return single instance."""
* cdef object instance
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_instance);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton_4_provide[] = "Return single instance.";
static PyObject *__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_5_provide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_provide (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, 1); __PYX_ERR(1, 1472, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_provide") < 0)) __PYX_ERR(1, 1472, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_args = ((PyObject*)values[0]);
__pyx_v_kwargs = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("_provide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1472, __pyx_L3_error)
2017-04-06 18:17:06 +03:00
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1472, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_r = __pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_4_provide(((struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_20ThreadLocalSingleton_4_provide(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("_provide", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_20ThreadLocalSingleton__provide(__pyx_v_self, __pyx_v_args, __pyx_v_kwargs, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1472, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.ThreadLocalSingleton._provide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1516
2017-04-06 18:17:06 +03:00
* """
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17AbstractSingleton___call__[] = "Return provided object.\n\n Callable interface implementation.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_17AbstractSingleton___call__;
#endif
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_19dependency_injector_9providers_17AbstractSingleton___call__(((struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton___call__(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("__call__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1521
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1522
2017-04-06 18:17:06 +03:00
* """
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self)) # <<<<<<<<<<<<<<
* return self.__last_overriding._provide(args, kwargs)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_before_cal, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1522, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1521
2017-04-06 18:17:06 +03:00
* Callable interface implementation.
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs)
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1523
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding._provide(args, kwargs) # <<<<<<<<<<<<<<
*
* def override(self, provider):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = ((struct __pyx_vtabstruct_19dependency_injector_9providers_Provider *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding->__pyx_vtab)->_provide(__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding, __pyx_v_args, __pyx_v_kwargs, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1523, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1516
2017-04-06 18:17:06 +03:00
* """
*
* def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* """Return provided object.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.AbstractSingleton.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1525
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
2017-04-06 18:17:06 +03:00
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17AbstractSingleton_2override[] = "Override provider with another provider.\n\n :param provider: Overriding provider.\n :type provider: :py:class:`Provider`\n\n :raise: :py:exc:`dependency_injector.errors.Error`\n\n :return: Overriding context.\n :rtype: :py:class:`OverridingContext`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_3override(PyObject *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("override (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_17AbstractSingleton_2override(((struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *)__pyx_v_self), ((PyObject *)__pyx_v_provider));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton_2override(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self, PyObject *__pyx_v_provider) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("override", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1536
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, BaseSingleton): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, BaseSingleton))
*/
2017-04-06 18:17:06 +03:00
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_provider, __pyx_ptype_19dependency_injector_9providers_BaseSingleton);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1537
2017-04-06 18:17:06 +03:00
* """
* if not isinstance(provider, BaseSingleton):
* raise Error('{0} must be overridden only by ' # <<<<<<<<<<<<<<
* '{1} providers'.format(self, BaseSingleton))
* return super(AbstractSingleton, self).override(provider)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1538
2017-04-06 18:17:06 +03:00
* if not isinstance(provider, BaseSingleton):
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, BaseSingleton)) # <<<<<<<<<<<<<<
* return super(AbstractSingleton, self).override(provider)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_only_by_1, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1538, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1538, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1538, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1538, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1538, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
2017-04-06 18:17:06 +03:00
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1537, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1536
2017-04-06 18:17:06 +03:00
* :rtype: :py:class:`OverridingContext`
* """
* if not isinstance(provider, BaseSingleton): # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, BaseSingleton))
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1539
2017-04-06 18:17:06 +03:00
* raise Error('{0} must be overridden only by '
* '{1} providers'.format(self, BaseSingleton))
* return super(AbstractSingleton, self).override(provider) # <<<<<<<<<<<<<<
*
2017-04-06 18:17:06 +03:00
* def reset(self):
*/
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractSingleton));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractSingleton));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_AbstractSingleton));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_override); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
2017-04-06 18:17:06 +03:00
}
if (!__pyx_t_9) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_provider); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1539, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_provider};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1539, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_provider);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1539, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1525
2017-04-06 18:17:06 +03:00
* return self.__last_overriding._provide(args, kwargs)
*
* def override(self, provider): # <<<<<<<<<<<<<<
* """Override provider with another provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("dependency_injector.providers.AbstractSingleton.override", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1541
2017-04-06 18:17:06 +03:00
* return super(AbstractSingleton, self).override(provider)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* Python wrapper */
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_17AbstractSingleton_4reset[] = "Reset cached instance, if any.\n\n :rtype: None\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_17AbstractSingleton_4reset(((struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-04-06 18:17:06 +03:00
static PyObject *__pyx_pf_19dependency_injector_9providers_17AbstractSingleton_4reset(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
2017-04-06 18:17:06 +03:00
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("reset", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1546
2017-04-06 18:17:06 +03:00
* :rtype: None
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding.reset()
*/
__pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1547
2017-04-06 18:17:06 +03:00
* """
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self)) # <<<<<<<<<<<<<<
* return self.__last_overriding.reset()
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_must_be_overridden_before_cal, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
if (!__pyx_t_7) {
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
PyObject *__pyx_temp[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1547, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1546
2017-04-06 18:17:06 +03:00
* :rtype: None
* """
* if self.__last_overriding is None: # <<<<<<<<<<<<<<
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding.reset()
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1548
2017-04-06 18:17:06 +03:00
* if self.__last_overriding is None:
* raise Error('{0} must be overridden before calling'.format(self))
* return self.__last_overriding.reset() # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx___last_overriding), __pyx_n_s_reset); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1548, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_8) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1548, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1548, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1541
2017-04-06 18:17:06 +03:00
* return super(AbstractSingleton, self).override(provider)
*
* def reset(self): # <<<<<<<<<<<<<<
* """Reset cached instance, if any.
*
*/
/* function exit code */
__pyx_L1_error:;
2017-04-06 18:17:06 +03:00
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.AbstractSingleton.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1558
* """Positional injection class."""
*
* def __init__(self, value): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__value = value
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_19PositionalInjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19PositionalInjection___init__[] = "Initializer.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_19PositionalInjection___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_19PositionalInjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_value = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 1558, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_value = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1558, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.PositionalInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_19PositionalInjection___init__(((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_v_self), __pyx_v_value);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_19PositionalInjection___init__(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1560
* def __init__(self, value):
* """Initializer."""
* self.__value = value # <<<<<<<<<<<<<<
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
*/
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
__Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___value);
__Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___value);
__pyx_v_self->__pyx_base.__pyx___value = __pyx_v_value;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1561
* """Initializer."""
* self.__value = value
* self.__is_provider = <int>is_provider(value) # <<<<<<<<<<<<<<
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and
*/
__pyx_v_self->__pyx_base.__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_is_provider(__pyx_v_value, 0));
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1562
* self.__value = value
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value) # <<<<<<<<<<<<<<
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0)
*/
__pyx_v_self->__pyx_base.__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_is_delegated(__pyx_v_value, 0));
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1563
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and # <<<<<<<<<<<<<<
* self.__is_delegated == 0)
* super(PositionalInjection, self).__init__()
*/
__pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_provider == 1);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1564
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0) # <<<<<<<<<<<<<<
* super(PositionalInjection, self).__init__()
*
*/
__pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_delegated == 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L3_bool_binop_done:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1563
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and # <<<<<<<<<<<<<<
* self.__is_delegated == 0)
* super(PositionalInjection, self).__init__()
*/
__pyx_v_self->__pyx_base.__pyx___call = ((int)__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1565
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0)
* super(PositionalInjection, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_PositionalInjection));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_PositionalInjection));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_PositionalInjection));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1565, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1565, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1558
* """Positional injection class."""
*
* def __init__(self, value): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__value = value
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.PositionalInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1567
* super(PositionalInjection, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19PositionalInjection_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_19PositionalInjection_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1569
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1570
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
* return self.__class__(deepcopy(self.__value, memo))
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1571
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
* return self.__class__(deepcopy(self.__value, memo))
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1570
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
* return self.__class__(deepcopy(self.__value, memo))
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1572
* if copied is not None:
* return copied
* return self.__class__(deepcopy(self.__value, memo)) # <<<<<<<<<<<<<<
*
* def get_value(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __pyx_v_self->__pyx_base.__pyx___value;
__Pyx_INCREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1572, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1567
* super(PositionalInjection, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.PositionalInjection.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1574
* return self.__class__(deepcopy(self.__value, memo))
*
* def get_value(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_value(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_5get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19PositionalInjection_4get_value[] = "Return injection value.";
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_5get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_value (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_19PositionalInjection_4get_value(((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_4get_value(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_value", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1576
* def get_value(self):
* """Return injection value."""
* return __get_value(self) # <<<<<<<<<<<<<<
*
* def get_original_value(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1574
* return self.__class__(deepcopy(self.__value, memo))
*
* def get_value(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_value(self)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.PositionalInjection.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1578
* return __get_value(self)
*
* def get_original_value(self): # <<<<<<<<<<<<<<
* """Return original value."""
* return self.__value
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_7get_original_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_19PositionalInjection_6get_original_value[] = "Return original value.";
static PyObject *__pyx_pw_19dependency_injector_9providers_19PositionalInjection_7get_original_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_original_value (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_19PositionalInjection_6get_original_value(((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_19PositionalInjection_6get_original_value(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_original_value", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1580
* def get_original_value(self):
* """Return original value."""
* return self.__value # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___value);
__pyx_r = __pyx_v_self->__pyx_base.__pyx___value;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1578
* return __get_value(self)
*
* def get_original_value(self): # <<<<<<<<<<<<<<
* """Return original value."""
* return self.__value
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1586
* """Keyword injection class."""
*
* def __init__(self, name, value): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__name = name
*/
/* Python wrapper */
static int __pyx_pw_19dependency_injector_9providers_14NamedInjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_14NamedInjection___init__[] = "Initializer.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_19dependency_injector_9providers_14NamedInjection___init__;
#endif
static int __pyx_pw_19dependency_injector_9providers_14NamedInjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_value = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_value,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 1586, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 1586, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_name = values[0];
__pyx_v_value = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1586, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.NamedInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_14NamedInjection___init__(((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_v_self), __pyx_v_name, __pyx_v_value);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_19dependency_injector_9providers_14NamedInjection___init__(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("__init__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1588
* def __init__(self, name, value):
* """Initializer."""
* self.__name = name # <<<<<<<<<<<<<<
* self.__value = value
* self.__is_provider = <int>is_provider(value)
*/
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
__Pyx_GOTREF(__pyx_v_self->__pyx___name);
__Pyx_DECREF(__pyx_v_self->__pyx___name);
__pyx_v_self->__pyx___name = __pyx_v_name;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1589
* """Initializer."""
* self.__name = name
* self.__value = value # <<<<<<<<<<<<<<
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
*/
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
__Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___value);
__Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___value);
__pyx_v_self->__pyx_base.__pyx___value = __pyx_v_value;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1590
* self.__name = name
* self.__value = value
* self.__is_provider = <int>is_provider(value) # <<<<<<<<<<<<<<
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and
*/
__pyx_v_self->__pyx_base.__pyx___is_provider = ((int)__pyx_f_19dependency_injector_9providers_is_provider(__pyx_v_value, 0));
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1591
* self.__value = value
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value) # <<<<<<<<<<<<<<
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0)
*/
__pyx_v_self->__pyx_base.__pyx___is_delegated = ((int)__pyx_f_19dependency_injector_9providers_is_delegated(__pyx_v_value, 0));
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1592
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and # <<<<<<<<<<<<<<
* self.__is_delegated == 0)
* super(NamedInjection, self).__init__()
*/
__pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_provider == 1);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1593
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0) # <<<<<<<<<<<<<<
* super(NamedInjection, self).__init__()
*
*/
__pyx_t_2 = (__pyx_v_self->__pyx_base.__pyx___is_delegated == 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L3_bool_binop_done:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1592
* self.__is_provider = <int>is_provider(value)
* self.__is_delegated = <int>is_delegated(value)
* self.__call = <int>(self.__is_provider == 1 and # <<<<<<<<<<<<<<
* self.__is_delegated == 0)
* super(NamedInjection, self).__init__()
*/
__pyx_v_self->__pyx_base.__pyx___call = ((int)__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1594
* self.__call = <int>(self.__is_provider == 1 and
* self.__is_delegated == 0)
* super(NamedInjection, self).__init__() # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, memo):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_NamedInjection));
__Pyx_GIVEREF(((PyObject *)__pyx_ptype_19dependency_injector_9providers_NamedInjection));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_19dependency_injector_9providers_NamedInjection));
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1594, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1594, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1594, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1586
* """Keyword injection class."""
*
* def __init__(self, name, value): # <<<<<<<<<<<<<<
* """Initializer."""
* self.__name = name
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.NamedInjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1596
* super(NamedInjection, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_14NamedInjection_2__deepcopy__[] = "Create and return full copy of provider.";
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_3__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_14NamedInjection_2__deepcopy__(((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_v_self), ((PyObject *)__pyx_v_memo));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_2__deepcopy__(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_copied = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_8;
int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1598
* def __deepcopy__(self, memo):
* """Create and return full copy of provider."""
* copied = memo.get(id(self)) # <<<<<<<<<<<<<<
* if copied is not None:
* return copied
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_memo, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
if (!__pyx_t_3) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_copied = __pyx_t_1;
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1599
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
* return self.__class__(deepcopy(self.__name, memo),
*/
__pyx_t_6 = (__pyx_v_copied != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1600
* copied = memo.get(id(self))
* if copied is not None:
* return copied # <<<<<<<<<<<<<<
* return self.__class__(deepcopy(self.__name, memo),
* deepcopy(self.__value, memo))
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_copied);
__pyx_r = __pyx_v_copied;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1599
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
* if copied is not None: # <<<<<<<<<<<<<<
* return copied
* return self.__class__(deepcopy(self.__name, memo),
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1601
* if copied is not None:
* return copied
* return self.__class__(deepcopy(self.__name, memo), # <<<<<<<<<<<<<<
* deepcopy(self.__value, memo))
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __pyx_v_self->__pyx___name;
__Pyx_INCREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1601, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1602
* return copied
* return self.__class__(deepcopy(self.__name, memo),
* deepcopy(self.__value, memo)) # <<<<<<<<<<<<<<
*
* def get_name(self):
*/
__pyx_t_5 = __pyx_v_self->__pyx_base.__pyx___value;
__Pyx_INCREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
if (!(likely(PyDict_CheckExact(__pyx_v_memo))||((__pyx_v_memo) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_memo)->tp_name), 0))) __PYX_ERR(1, 1602, __pyx_L1_error)
__pyx_t_8.__pyx_n = 1;
__pyx_t_8.memo = ((PyObject*)__pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_t_5, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_9 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_9 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1596
* super(NamedInjection, self).__init__()
*
* def __deepcopy__(self, memo): # <<<<<<<<<<<<<<
* """Create and return full copy of provider."""
* copied = memo.get(id(self))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("dependency_injector.providers.NamedInjection.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_copied);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1604
* deepcopy(self.__value, memo))
*
* def get_name(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_name(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_5get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_14NamedInjection_4get_name[] = "Return injection value.";
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_5get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_name (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_14NamedInjection_4get_name(((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_4get_name(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_name", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1606
* def get_name(self):
* """Return injection value."""
* return __get_name(self) # <<<<<<<<<<<<<<
*
* def get_value(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1606, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1604
* deepcopy(self.__value, memo))
*
* def get_name(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_name(self)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.NamedInjection.get_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1608
* return __get_name(self)
*
* def get_value(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_value(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_7get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_14NamedInjection_6get_value[] = "Return injection value.";
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_7get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_value (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_14NamedInjection_6get_value(((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_6get_value(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_value", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1610
* def get_value(self):
* """Return injection value."""
* return __get_value(self) # <<<<<<<<<<<<<<
*
* def get_original_value(self):
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1610, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1608
* return __get_name(self)
*
* def get_value(self): # <<<<<<<<<<<<<<
* """Return injection value."""
* return __get_value(self)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.NamedInjection.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1612
* return __get_value(self)
*
* def get_original_value(self): # <<<<<<<<<<<<<<
* """Return original value."""
* return self.__value
*/
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_9get_original_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_14NamedInjection_8get_original_value[] = "Return original value.";
static PyObject *__pyx_pw_19dependency_injector_9providers_14NamedInjection_9get_original_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_original_value (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_14NamedInjection_8get_original_value(((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_14NamedInjection_8get_original_value(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_original_value", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1614
* def get_original_value(self):
* """Return original value."""
* return self.__value # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___value);
__pyx_r = __pyx_v_self->__pyx_base.__pyx___value;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1612
* return __get_value(self)
*
* def get_original_value(self): # <<<<<<<<<<<<<<
* """Return original value."""
* return self.__value
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1619
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cpdef tuple parse_positional_injections(tuple args): # <<<<<<<<<<<<<<
* """Parse positional injections."""
* cdef list injections = list()
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_1parse_positional_injections(PyObject *__pyx_self, PyObject *__pyx_v_args); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_parse_positional_injections(PyObject *__pyx_v_args, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_v_injections = 0;
int __pyx_v_args_len;
int __pyx_v_index;
PyObject *__pyx_v_arg = 0;
struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_injection = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("parse_positional_injections", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1621
* cpdef tuple parse_positional_injections(tuple args):
* """Parse positional injections."""
* cdef list injections = list() # <<<<<<<<<<<<<<
* cdef int args_len = len(args)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_injections = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1622
* """Parse positional injections."""
* cdef list injections = list()
* cdef int args_len = len(args) # <<<<<<<<<<<<<<
*
* cdef int index
*/
if (unlikely(__pyx_v_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1622, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 1622, __pyx_L1_error)
__pyx_v_args_len = __pyx_t_2;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1628
* cdef PositionalInjection injection
*
* for index in range(args_len): # <<<<<<<<<<<<<<
* arg = args[index]
* injection = PositionalInjection(arg)
*/
__pyx_t_3 = __pyx_v_args_len;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1629
*
* for index in range(args_len):
* arg = args[index] # <<<<<<<<<<<<<<
* injection = PositionalInjection(arg)
* injections.append(injection)
*/
if (unlikely(__pyx_v_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1629, __pyx_L1_error)
}
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_args, __pyx_v_index);
__Pyx_INCREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1630
* for index in range(args_len):
* arg = args[index]
* injection = PositionalInjection(arg) # <<<<<<<<<<<<<<
* injections.append(injection)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_arg);
__Pyx_GIVEREF(__pyx_v_arg);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arg);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_PositionalInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_t_5));
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1631
* arg = args[index]
* injection = PositionalInjection(arg)
* injections.append(injection) # <<<<<<<<<<<<<<
*
* return tuple(injections)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(1, 1631, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1633
* injections.append(injection)
*
* return tuple(injections) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1619
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cpdef tuple parse_positional_injections(tuple args): # <<<<<<<<<<<<<<
* """Parse positional injections."""
* cdef list injections = list()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.parse_positional_injections", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_injections);
__Pyx_XDECREF(__pyx_v_arg);
__Pyx_XDECREF((PyObject *)__pyx_v_injection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_1parse_positional_injections(PyObject *__pyx_self, PyObject *__pyx_v_args); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_parse_positional_injections[] = "Parse positional injections.";
static PyObject *__pyx_pw_19dependency_injector_9providers_1parse_positional_injections(PyObject *__pyx_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("parse_positional_injections (wrapper)", 0);
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 1619, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_parse_positional_injections(__pyx_self, ((PyObject*)__pyx_v_args));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_parse_positional_injections(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("parse_positional_injections", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_positional_injections(__pyx_v_args, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.parse_positional_injections", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1638
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cpdef tuple parse_named_injections(dict kwargs): # <<<<<<<<<<<<<<
* """Parse named injections."""
* cdef list injections = list()
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_3parse_named_injections(PyObject *__pyx_self, PyObject *__pyx_v_kwargs); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_parse_named_injections(PyObject *__pyx_v_kwargs, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_v_injections = 0;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_arg = 0;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_injection = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_t_9;
__Pyx_RefNannySetupContext("parse_named_injections", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1640
* cpdef tuple parse_named_injections(dict kwargs):
* """Parse named injections."""
* cdef list injections = list() # <<<<<<<<<<<<<<
*
* cdef object name
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1640, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_injections = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1646
* cdef NamedInjection injection
*
* for name, arg in kwargs.items(): # <<<<<<<<<<<<<<
* injection = NamedInjection(name, arg)
* injections.append(injection)
*/
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1646, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1646, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1646, __pyx_L1_error)
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1646, __pyx_L1_error)
#else
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
__pyx_t_1 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2017-07-09 23:29:33 +03:00
else __PYX_ERR(1, 1646, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_1);
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
#if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1646, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
2017-07-09 23:29:33 +03:00
__pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
2017-07-09 23:29:33 +03:00
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(1, 1646, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1646, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6);
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1647
*
* for name, arg in kwargs.items():
* injection = NamedInjection(name, arg) # <<<<<<<<<<<<<<
* injections.append(injection)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name);
__Pyx_INCREF(__pyx_v_arg);
__Pyx_GIVEREF(__pyx_v_arg);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_arg);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_19dependency_injector_9providers_NamedInjection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_6));
__pyx_t_6 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1648
* for name, arg in kwargs.items():
* injection = NamedInjection(name, arg)
* injections.append(injection) # <<<<<<<<<<<<<<
*
* return tuple(injections)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_injections, ((PyObject *)__pyx_v_injection)); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 1648, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1646
* cdef NamedInjection injection
*
* for name, arg in kwargs.items(): # <<<<<<<<<<<<<<
* injection = NamedInjection(name, arg)
* injections.append(injection)
*/
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1650
* injections.append(injection)
*
* return tuple(injections) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyList_AsTuple(__pyx_v_injections); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1638
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cpdef tuple parse_named_injections(dict kwargs): # <<<<<<<<<<<<<<
* """Parse named injections."""
* cdef list injections = list()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("dependency_injector.providers.parse_named_injections", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_injections);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_arg);
__Pyx_XDECREF((PyObject *)__pyx_v_injection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_3parse_named_injections(PyObject *__pyx_self, PyObject *__pyx_v_kwargs); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_2parse_named_injections[] = "Parse named injections.";
static PyObject *__pyx_pw_19dependency_injector_9providers_3parse_named_injections(PyObject *__pyx_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("parse_named_injections (wrapper)", 0);
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 1638, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_2parse_named_injections(__pyx_self, ((PyObject*)__pyx_v_kwargs));
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_2parse_named_injections(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("parse_named_injections", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_parse_named_injections(__pyx_v_kwargs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.parse_named_injections", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1653
*
*
* cpdef bint is_provider(object instance): # <<<<<<<<<<<<<<
* """Check if instance is provider instance.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_5is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static int __pyx_f_19dependency_injector_9providers_is_provider(PyObject *__pyx_v_instance, CYTHON_UNUSED int __pyx_skip_dispatch) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
__Pyx_RefNannySetupContext("is_provider", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1661
* :rtype: bool
* """
* return (not isinstance(instance, CLASS_TYPES) and # <<<<<<<<<<<<<<
* getattr(instance, '__IS_PROVIDER__', False) is True)
*
*/
__pyx_t_2 = __pyx_v_19dependency_injector_9providers_CLASS_TYPES;
__Pyx_INCREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyObject_IsInstance(__pyx_v_instance, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1661, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1662
* """
* return (not isinstance(instance, CLASS_TYPES) and
* getattr(instance, '__IS_PROVIDER__', False) is True) # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_GetAttr3(__pyx_v_instance, __pyx_n_s_IS_PROVIDER, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (__pyx_t_2 == Py_True);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
__pyx_r = __pyx_t_1;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1653
*
*
* cpdef bint is_provider(object instance): # <<<<<<<<<<<<<<
* """Check if instance is provider instance.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_WriteUnraisable("dependency_injector.providers.is_provider", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_5is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_4is_provider[] = "Check if instance is provider instance.\n\n :param instance: Instance to be checked.\n :type instance: object\n\n :rtype: bool\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_5is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_provider (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_4is_provider(__pyx_self, ((PyObject *)__pyx_v_instance));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_4is_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_provider", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_19dependency_injector_9providers_is_provider(__pyx_v_instance, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.is_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1665
*
*
* cpdef object ensure_is_provider(object instance): # <<<<<<<<<<<<<<
* """Check if instance is provider instance and return it.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_7ensure_is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_ensure_is_provider(PyObject *__pyx_v_instance, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_RefNannySetupContext("ensure_is_provider", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1676
* :rtype: :py:class:`dependency_injector.providers.Provider`
* """
* if not is_provider(instance): # <<<<<<<<<<<<<<
* raise Error('Expected provider instance, '
* 'got {0}'.format(str(instance)))
*/
__pyx_t_1 = ((!(__pyx_f_19dependency_injector_9providers_is_provider(__pyx_v_instance, 0) != 0)) != 0);
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1677
* """
* if not is_provider(instance):
* raise Error('Expected provider instance, ' # <<<<<<<<<<<<<<
* 'got {0}'.format(str(instance)))
* return instance
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1678
* if not is_provider(instance):
* raise Error('Expected provider instance, '
* 'got {0}'.format(str(instance))) # <<<<<<<<<<<<<<
* return instance
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Expected_provider_instance_got_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2017-07-09 23:29:33 +03:00
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_instance);
__Pyx_GIVEREF(__pyx_v_instance);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_instance);
2017-07-09 23:29:33 +03:00
__pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
if (!__pyx_t_6) {
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_7};
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
__pyx_t_7 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_5) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
__pyx_t_4 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
__PYX_ERR(1, 1677, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1676
* :rtype: :py:class:`dependency_injector.providers.Provider`
* """
* if not is_provider(instance): # <<<<<<<<<<<<<<
* raise Error('Expected provider instance, '
* 'got {0}'.format(str(instance)))
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1679
* raise Error('Expected provider instance, '
* 'got {0}'.format(str(instance)))
* return instance # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_instance);
__pyx_r = __pyx_v_instance;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1665
*
*
* cpdef object ensure_is_provider(object instance): # <<<<<<<<<<<<<<
* """Check if instance is provider instance and return it.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("dependency_injector.providers.ensure_is_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_7ensure_is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_6ensure_is_provider[] = "Check if instance is provider instance and return it.\n\n :param instance: Instance to be checked.\n :type instance: object\n\n :raise: :py:exc:`dependency_injector.errors.Error` if provided instance is\n not provider.\n\n :rtype: :py:class:`dependency_injector.providers.Provider`\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_7ensure_is_provider(PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("ensure_is_provider (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_6ensure_is_provider(__pyx_self, ((PyObject *)__pyx_v_instance));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_6ensure_is_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("ensure_is_provider", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_ensure_is_provider(__pyx_v_instance, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1665, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.ensure_is_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1682
*
*
* cpdef bint is_delegated(object instance): # <<<<<<<<<<<<<<
* """Check if instance is delegated provider.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_9is_delegated(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static int __pyx_f_19dependency_injector_9providers_is_delegated(PyObject *__pyx_v_instance, CYTHON_UNUSED int __pyx_skip_dispatch) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
__Pyx_RefNannySetupContext("is_delegated", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1690
* :rtype: bool
* """
* return (not isinstance(instance, CLASS_TYPES) and # <<<<<<<<<<<<<<
* getattr(instance, '__IS_DELEGATED__', False) is True)
*
*/
__pyx_t_2 = __pyx_v_19dependency_injector_9providers_CLASS_TYPES;
__Pyx_INCREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyObject_IsInstance(__pyx_v_instance, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1690, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_1 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1691
* """
* return (not isinstance(instance, CLASS_TYPES) and
* getattr(instance, '__IS_DELEGATED__', False) is True) # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_GetAttr3(__pyx_v_instance, __pyx_n_s_IS_DELEGATED, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1691, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = (__pyx_t_2 == Py_True);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
__pyx_r = __pyx_t_1;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1682
*
*
* cpdef bint is_delegated(object instance): # <<<<<<<<<<<<<<
* """Check if instance is delegated provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_WriteUnraisable("dependency_injector.providers.is_delegated", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_9is_delegated(PyObject *__pyx_self, PyObject *__pyx_v_instance); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_8is_delegated[] = "Check if instance is delegated provider.\n\n :param instance: Instance to be checked.\n :type instance: object\n\n :rtype: bool\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_9is_delegated(PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_delegated (wrapper)", 0);
__pyx_r = __pyx_pf_19dependency_injector_9providers_8is_delegated(__pyx_self, ((PyObject *)__pyx_v_instance));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_8is_delegated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_delegated", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_19dependency_injector_9providers_is_delegated(__pyx_v_instance, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1682, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.is_delegated", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1694
*
*
* cpdef str represent_provider(object provider, object provides): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_11represent_provider(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_represent_provider(PyObject *__pyx_v_provider, PyObject *__pyx_v_provides, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("represent_provider", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1706
* :rtype: str
* """
* return '<{provider}({provides}) at {address}>'.format( # <<<<<<<<<<<<<<
* provider='.'.join((provider.__class__.__module__,
* provider.__class__.__name__)),
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_provider_provides_at_address, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1707
* """
* return '<{provider}({provides}) at {address}>'.format(
* provider='.'.join((provider.__class__.__module__, # <<<<<<<<<<<<<<
* provider.__class__.__name__)),
* provides=repr(provides) if provides is not None else '',
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1708
* return '<{provider}({provides}) at {address}>'.format(
* provider='.'.join((provider.__class__.__module__,
* provider.__class__.__name__)), # <<<<<<<<<<<<<<
* provides=repr(provides) if provides is not None else '',
* address=hex(id(provider)))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_provider, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1708, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1708, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1707
* """
* return '<{provider}({provides}) at {address}>'.format(
* provider='.'.join((provider.__class__.__module__, # <<<<<<<<<<<<<<
* provider.__class__.__name__)),
* provides=repr(provides) if provides is not None else '',
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_provider, __pyx_t_5) < 0) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1709
* provider='.'.join((provider.__class__.__module__,
* provider.__class__.__name__)),
* provides=repr(provides) if provides is not None else '', # <<<<<<<<<<<<<<
* address=hex(id(provider)))
*
*/
__pyx_t_6 = (__pyx_v_provides != Py_None);
if ((__pyx_t_6 != 0)) {
2017-07-09 23:29:33 +03:00
__pyx_t_3 = PyObject_Repr(__pyx_v_provides); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1709, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __pyx_t_3;
__pyx_t_3 = 0;
} else {
__Pyx_INCREF(__pyx_kp_s__10);
__pyx_t_5 = __pyx_kp_s__10;
}
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_provides, __pyx_t_5) < 0) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1710
* provider.__class__.__name__)),
* provides=repr(provides) if provides is not None else '',
* address=hex(id(provider))) # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_provider);
__Pyx_GIVEREF(__pyx_v_provider);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_provider);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_address, __pyx_t_3) < 0) __PYX_ERR(1, 1707, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1706
* :rtype: str
* """
* return '<{provider}({provides}) at {address}>'.format( # <<<<<<<<<<<<<<
* provider='.'.join((provider.__class__.__module__,
* provider.__class__.__name__)),
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 1706, __pyx_L1_error)
__pyx_r = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1694
*
*
* cpdef str represent_provider(object provider, object provides): # <<<<<<<<<<<<<<
* """Return string representation of provider.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.represent_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_11represent_provider(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_10represent_provider[] = "Return string representation of provider.\n\n :param provider: Provider object\n :type provider: :py:class:`dependency_injector.providers.Provider`\n\n :param provides: Object that provider provides\n :type provider: object\n\n :return: String representation of provider\n :rtype: str\n ";
static PyObject *__pyx_pw_19dependency_injector_9providers_11represent_provider(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_provider = 0;
PyObject *__pyx_v_provides = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("represent_provider (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_provider,&__pyx_n_s_provides,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provider)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_provides)) != 0)) kw_args--;
else {
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("represent_provider", 1, 2, 2, 1); __PYX_ERR(1, 1694, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "represent_provider") < 0)) __PYX_ERR(1, 1694, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_provider = values[0];
__pyx_v_provides = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("represent_provider", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1694, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.represent_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_19dependency_injector_9providers_10represent_provider(__pyx_self, __pyx_v_provider, __pyx_v_provides);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_10represent_provider(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_provider, PyObject *__pyx_v_provides) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("represent_provider", 0);
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_represent_provider(__pyx_v_provider, __pyx_v_provides, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.represent_provider", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1713
*
*
* cpdef object deepcopy(object instance, dict memo=None): # <<<<<<<<<<<<<<
* """Return full copy of provider or container with providers."""
* return copy.deepcopy(instance, memo)
*/
static PyObject *__pyx_pw_19dependency_injector_9providers_13deepcopy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_19dependency_injector_9providers_deepcopy(PyObject *__pyx_v_instance, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_19dependency_injector_9providers_deepcopy *__pyx_optional_args) {
PyObject *__pyx_v_memo = ((PyObject*)Py_None);
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("deepcopy", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_memo = __pyx_optional_args->memo;
}
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1715
* cpdef object deepcopy(object instance, dict memo=None):
* """Return full copy of provider or container with providers."""
* return copy.deepcopy(instance, memo) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_instance, __pyx_v_memo};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_instance, __pyx_v_memo};
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_2) {
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
}
__Pyx_INCREF(__pyx_v_instance);
__Pyx_GIVEREF(__pyx_v_instance);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_instance);
__Pyx_INCREF(__pyx_v_memo);
__Pyx_GIVEREF(__pyx_v_memo);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_memo);
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1715, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1713
*
*
* cpdef object deepcopy(object instance, dict memo=None): # <<<<<<<<<<<<<<
* """Return full copy of provider or container with providers."""
* return copy.deepcopy(instance, memo)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.deepcopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_19dependency_injector_9providers_13deepcopy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_19dependency_injector_9providers_12deepcopy[] = "Return full copy of provider or container with providers.";
static PyObject *__pyx_pw_19dependency_injector_9providers_13deepcopy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_instance = 0;
PyObject *__pyx_v_memo = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("deepcopy (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_instance,&__pyx_n_s_memo,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject*)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_instance)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_memo);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
2017-07-09 23:29:33 +03:00
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deepcopy") < 0)) __PYX_ERR(1, 1713, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_instance = values[0];
__pyx_v_memo = ((PyObject*)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
2017-07-09 23:29:33 +03:00
__Pyx_RaiseArgtupleInvalid("deepcopy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1713, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("dependency_injector.providers.deepcopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
2017-07-09 23:29:33 +03:00
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memo), (&PyDict_Type), 1, "memo", 1))) __PYX_ERR(1, 1713, __pyx_L1_error)
__pyx_r = __pyx_pf_19dependency_injector_9providers_12deepcopy(__pyx_self, __pyx_v_instance, __pyx_v_memo);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_19dependency_injector_9providers_12deepcopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_memo) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
struct __pyx_opt_args_19dependency_injector_9providers_deepcopy __pyx_t_2;
__Pyx_RefNannySetupContext("deepcopy", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.memo = __pyx_v_memo;
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers_deepcopy(__pyx_v_instance, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1713, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("dependency_injector.providers.deepcopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":178
*
* # Inline helper functions
* cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<<
* return self.__name
*
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_name(struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get_name", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":179
* # Inline helper functions
* cdef inline object __get_name(NamedInjection self):
* return self.__name # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___name);
__pyx_r = __pyx_v_self->__pyx___name;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":178
*
* # Inline helper functions
* cdef inline object __get_name(NamedInjection self): # <<<<<<<<<<<<<<
* return self.__name
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":182
*
*
* cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<<
* if self.__call == 0:
* return self.__value
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___get_value(struct __pyx_obj_19dependency_injector_9providers_Injection *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_RefNannySetupContext("__get_value", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":183
*
* cdef inline object __get_value(Injection self):
* if self.__call == 0: # <<<<<<<<<<<<<<
* return self.__value
* return self.__value()
*/
__pyx_t_1 = ((__pyx_v_self->__pyx___call == 0) != 0);
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":184
* cdef inline object __get_value(Injection self):
* if self.__call == 0:
* return self.__value # <<<<<<<<<<<<<<
* return self.__value()
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___value);
__pyx_r = __pyx_v_self->__pyx___value;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":183
*
* cdef inline object __get_value(Injection self):
* if self.__call == 0: # <<<<<<<<<<<<<<
* return self.__value
* return self.__value()
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":185
* if self.__call == 0:
* return self.__value
* return self.__value() # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->__pyx___value);
__pyx_t_3 = __pyx_v_self->__pyx___value; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":182
*
*
* cdef inline object __get_value(Injection self): # <<<<<<<<<<<<<<
* if self.__call == 0:
* return self.__value
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("dependency_injector.providers.__get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":190
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<<
* tuple inj_args,
* int inj_args_len):
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provide_positional_args(PyObject *__pyx_v_args, PyObject *__pyx_v_inj_args, int __pyx_v_inj_args_len) {
int __pyx_v_index;
PyObject *__pyx_v_positional_args = 0;
struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *__pyx_v_injection = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
__Pyx_RefNannySetupContext("__provide_positional_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":197
* cdef PositionalInjection injection
*
* if inj_args_len == 0: # <<<<<<<<<<<<<<
* return args
*
*/
__pyx_t_1 = ((__pyx_v_inj_args_len == 0) != 0);
if (__pyx_t_1) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":198
*
* if inj_args_len == 0:
* return args # <<<<<<<<<<<<<<
*
* positional_args = list()
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_args);
__pyx_r = __pyx_v_args;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":197
* cdef PositionalInjection injection
*
* if inj_args_len == 0: # <<<<<<<<<<<<<<
* return args
*
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":200
* return args
*
* positional_args = list() # <<<<<<<<<<<<<<
* for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index]
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_positional_args = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":201
*
* positional_args = list()
* for index in range(inj_args_len): # <<<<<<<<<<<<<<
* injection = <PositionalInjection>inj_args[index]
* positional_args.append(__get_value(injection))
*/
__pyx_t_3 = __pyx_v_inj_args_len;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":202
* positional_args = list()
* for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index] # <<<<<<<<<<<<<<
* positional_args.append(__get_value(injection))
* positional_args.extend(args)
*/
if (unlikely(__pyx_v_inj_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 202, __pyx_L1_error)
}
__pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_inj_args, __pyx_v_index);
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_injection, ((struct __pyx_obj_19dependency_injector_9providers_PositionalInjection *)__pyx_t_2));
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":203
* for index in range(inj_args_len):
* injection = <PositionalInjection>inj_args[index]
* positional_args.append(__get_value(injection)) # <<<<<<<<<<<<<<
* positional_args.extend(args)
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_injection)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyList_Append(__pyx_v_positional_args, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":204
* injection = <PositionalInjection>inj_args[index]
* positional_args.append(__get_value(injection))
* positional_args.extend(args) # <<<<<<<<<<<<<<
*
* return tuple(positional_args)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyList_Extend(__pyx_v_positional_args, __pyx_v_args); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 204, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":206
* positional_args.extend(args)
*
* return tuple(positional_args) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = PyList_AsTuple(__pyx_v_positional_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":190
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline tuple __provide_positional_args(tuple args, # <<<<<<<<<<<<<<
* tuple inj_args,
* int inj_args_len):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.__provide_positional_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_positional_args);
__Pyx_XDECREF((PyObject *)__pyx_v_injection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":211
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<<
* tuple inj_kwargs,
* int inj_kwargs_len):
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___provide_keyword_args(PyObject *__pyx_v_kwargs, PyObject *__pyx_v_inj_kwargs, int __pyx_v_inj_kwargs_len) {
int __pyx_v_index;
PyObject *__pyx_v_name = 0;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_kw_injection = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_RefNannySetupContext("__provide_keyword_args", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":218
* cdef NamedInjection kw_injection
*
* if len(kwargs) == 0: # <<<<<<<<<<<<<<
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index]
*/
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 218, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = PyDict_Size(__pyx_v_kwargs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 218, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_1 == 0) != 0);
if (__pyx_t_2) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":219
*
* if len(kwargs) == 0:
* for index in range(inj_kwargs_len): # <<<<<<<<<<<<<<
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection)
*/
__pyx_t_3 = __pyx_v_inj_kwargs_len;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":220
* if len(kwargs) == 0:
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<<
* name = __get_name(kw_injection)
* kwargs[name] = __get_value(kw_injection)
*/
if (unlikely(__pyx_v_inj_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 220, __pyx_L1_error)
}
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index);
__Pyx_INCREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5));
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":221
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) # <<<<<<<<<<<<<<
* kwargs[name] = __get_value(kw_injection)
* else:
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":222
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection)
* kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<<
* else:
* for index in range(inj_kwargs_len):
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 222, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":218
* cdef NamedInjection kw_injection
*
* if len(kwargs) == 0: # <<<<<<<<<<<<<<
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index]
*/
goto __pyx_L3;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":224
* kwargs[name] = __get_value(kw_injection)
* else:
* for index in range(inj_kwargs_len): # <<<<<<<<<<<<<<
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection)
*/
/*else*/ {
__pyx_t_3 = __pyx_v_inj_kwargs_len;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":225
* else:
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index] # <<<<<<<<<<<<<<
* name = __get_name(kw_injection)
* if name not in kwargs:
*/
if (unlikely(__pyx_v_inj_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 225, __pyx_L1_error)
}
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_inj_kwargs, __pyx_v_index);
__Pyx_INCREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_kw_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_5));
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":226
* for index in range(inj_kwargs_len):
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection) # <<<<<<<<<<<<<<
* if name not in kwargs:
* kwargs[name] = __get_value(kw_injection)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_kw_injection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":227
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection)
* if name not in kwargs: # <<<<<<<<<<<<<<
* kwargs[name] = __get_value(kw_injection)
*
*/
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 227, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 227, __pyx_L1_error)
__pyx_t_6 = (__pyx_t_2 != 0);
if (__pyx_t_6) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":228
* name = __get_name(kw_injection)
* if name not in kwargs:
* kwargs[name] = __get_value(kw_injection) # <<<<<<<<<<<<<<
*
* return kwargs
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_kw_injection)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 228, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_v_name, __pyx_t_5) < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":227
* kw_injection = <NamedInjection>inj_kwargs[index]
* name = __get_name(kw_injection)
* if name not in kwargs: # <<<<<<<<<<<<<<
* kwargs[name] = __get_value(kw_injection)
*
*/
}
}
}
__pyx_L3:;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":230
* kwargs[name] = __get_value(kw_injection)
*
* return kwargs # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_kwargs);
__pyx_r = __pyx_v_kwargs;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":211
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline dict __provide_keyword_args(dict kwargs, # <<<<<<<<<<<<<<
* tuple inj_kwargs,
* int inj_kwargs_len):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("dependency_injector.providers.__provide_keyword_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF((PyObject *)__pyx_v_kw_injection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":235
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<<
* tuple attributes,
* int attributes_len):
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___inject_attributes(PyObject *__pyx_v_instance, PyObject *__pyx_v_attributes, int __pyx_v_attributes_len) {
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *__pyx_v_attr_injection = 0;
int __pyx_v_index;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
__Pyx_RefNannySetupContext("__inject_attributes", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":239
* int attributes_len):
* cdef NamedInjection attr_injection
* for index in range(attributes_len): # <<<<<<<<<<<<<<
* attr_injection = <NamedInjection>attributes[index]
* setattr(instance,
*/
__pyx_t_1 = __pyx_v_attributes_len;
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_index = __pyx_t_2;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":240
* cdef NamedInjection attr_injection
* for index in range(attributes_len):
* attr_injection = <NamedInjection>attributes[index] # <<<<<<<<<<<<<<
* setattr(instance,
* __get_name(attr_injection),
*/
if (unlikely(__pyx_v_attributes == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 240, __pyx_L1_error)
}
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_attributes, __pyx_v_index);
__Pyx_INCREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_attr_injection, ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)__pyx_t_3));
__pyx_t_3 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":242
* attr_injection = <NamedInjection>attributes[index]
* setattr(instance,
* __get_name(attr_injection), # <<<<<<<<<<<<<<
* __get_value(attr_injection))
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_3 = __pyx_f_19dependency_injector_9providers___get_name(__pyx_v_attr_injection); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":243
* setattr(instance,
* __get_name(attr_injection),
* __get_value(attr_injection)) # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __pyx_f_19dependency_injector_9providers___get_value(((struct __pyx_obj_19dependency_injector_9providers_Injection *)__pyx_v_attr_injection)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":241
* for index in range(attributes_len):
* attr_injection = <NamedInjection>attributes[index]
* setattr(instance, # <<<<<<<<<<<<<<
* __get_name(attr_injection),
* __get_value(attr_injection))
*/
2017-07-09 23:29:33 +03:00
__pyx_t_5 = PyObject_SetAttr(__pyx_v_instance, __pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 241, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":235
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef inline object __inject_attributes(object instance, # <<<<<<<<<<<<<<
* tuple attributes,
* int attributes_len):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("dependency_injector.providers.__inject_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_attr_injection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":246
*
*
* cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* cdef tuple positional_args
* cdef dict keyword_args
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callable_call(struct __pyx_obj_19dependency_injector_9providers_Callable *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_v_positional_args = 0;
PyObject *__pyx_v_keyword_args = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("__callable_call", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":251
*
* positional_args = __provide_positional_args(args,
* self.__args, # <<<<<<<<<<<<<<
* self.__args_len)
* keyword_args = __provide_keyword_args(kwargs,
*/
__pyx_t_1 = __pyx_v_self->__pyx___args;
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":250
* cdef dict keyword_args
*
* positional_args = __provide_positional_args(args, # <<<<<<<<<<<<<<
* self.__args,
* self.__args_len)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___provide_positional_args(__pyx_v_args, ((PyObject*)__pyx_t_1), __pyx_v_self->__pyx___args_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_positional_args = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":254
* self.__args_len)
* keyword_args = __provide_keyword_args(kwargs,
* self.__kwargs, # <<<<<<<<<<<<<<
* self.__kwargs_len)
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
__Pyx_INCREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":253
* self.__args,
* self.__args_len)
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
* self.__kwargs,
* self.__kwargs_len)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_keyword_args = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":257
* self.__kwargs_len)
*
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_positional_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 257, __pyx_L1_error)
}
if (unlikely(__pyx_v_keyword_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
2017-07-09 23:29:33 +03:00
__PYX_ERR(0, 257, __pyx_L1_error)
}
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->__pyx___provides, __pyx_v_positional_args, __pyx_v_keyword_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":246
*
*
* cdef inline object __callable_call(Callable self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* cdef tuple positional_args
* cdef dict keyword_args
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.__callable_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_positional_args);
__Pyx_XDECREF(__pyx_v_keyword_args);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":260
*
*
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* cdef object instance
*
*/
static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___factory_call(struct __pyx_obj_19dependency_injector_9providers_Factory *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
PyObject *__pyx_v_instance = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
__Pyx_RefNannySetupContext("__factory_call", 0);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":263
* cdef object instance
*
* instance = __callable_call(self.__instantiator, args, kwargs) # <<<<<<<<<<<<<<
*
* if self.__attributes_len > 0:
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___instantiator);
__Pyx_INCREF(__pyx_t_1);
2017-07-09 23:29:33 +03:00
__pyx_t_2 = __pyx_f_19dependency_injector_9providers___callable_call(((struct __pyx_obj_19dependency_injector_9providers_Callable *)__pyx_t_1), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_instance = __pyx_t_2;
__pyx_t_2 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":265
* instance = __callable_call(self.__instantiator, args, kwargs)
*
* if self.__attributes_len > 0: # <<<<<<<<<<<<<<
* __inject_attributes(instance,
* self.__attributes,
*/
__pyx_t_3 = ((__pyx_v_self->__pyx___attributes_len > 0) != 0);
if (__pyx_t_3) {
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":267
* if self.__attributes_len > 0:
* __inject_attributes(instance,
* self.__attributes, # <<<<<<<<<<<<<<
* self.__attributes_len)
*
*/
__pyx_t_2 = __pyx_v_self->__pyx___attributes;
__Pyx_INCREF(__pyx_t_2);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":266
*
* if self.__attributes_len > 0:
* __inject_attributes(instance, # <<<<<<<<<<<<<<
* self.__attributes,
* self.__attributes_len)
*/
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___inject_attributes(__pyx_v_instance, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___attributes_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":265
* instance = __callable_call(self.__instantiator, args, kwargs)
*
* if self.__attributes_len > 0: # <<<<<<<<<<<<<<
* __inject_attributes(instance,
* self.__attributes,
*/
}
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":270
* self.__attributes_len)
*
* return instance # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_instance);
__pyx_r = __pyx_v_instance;
goto __pyx_L0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":260
*
*
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* cdef object instance
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("dependency_injector.providers.__factory_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_instance);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static struct __pyx_vtabstruct_19dependency_injector_9providers_Provider __pyx_vtable_19dependency_injector_9providers_Provider;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Provider(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Provider *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)o);
p->__pyx_vtab = __pyx_vtabptr_19dependency_injector_9providers_Provider;
p->__pyx___overridden = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
p->__pyx___overriding_lock = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Provider(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Provider *p = (struct __pyx_obj_19dependency_injector_9providers_Provider *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___overridden);
Py_CLEAR(p->__pyx___last_overriding);
Py_CLEAR(p->__pyx___overriding_lock);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Provider(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Provider *p = (struct __pyx_obj_19dependency_injector_9providers_Provider *)o;
if (p->__pyx___overridden) {
e = (*v)(p->__pyx___overridden, a); if (e) return e;
}
if (p->__pyx___last_overriding) {
e = (*v)(((PyObject*)p->__pyx___last_overriding), a); if (e) return e;
}
if (p->__pyx___overriding_lock) {
e = (*v)(p->__pyx___overriding_lock, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Provider(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Provider *p = (struct __pyx_obj_19dependency_injector_9providers_Provider *)o;
tmp = ((PyObject*)p->__pyx___overridden);
p->__pyx___overridden = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___last_overriding);
p->__pyx___last_overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___overriding_lock);
p->__pyx___overriding_lock = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_8Provider_overridden(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_8Provider_10overridden_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_8Provider_last_overriding(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_8Provider_15last_overriding_1__get__(o);
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Provider[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_5__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_8Provider_4__deepcopy__},
{"override", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_11override, METH_O, __pyx_doc_19dependency_injector_9providers_8Provider_10override},
{"reset_last_overriding", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_13reset_last_overriding, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_8Provider_12reset_last_overriding},
{"reset_override", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_15reset_override, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_8Provider_14reset_override},
{"delegate", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_17delegate, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_8Provider_16delegate},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Provider_19_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Provider_18_provide},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_19dependency_injector_9providers_Provider[] = {
{(char *)"overridden", __pyx_getprop_19dependency_injector_9providers_8Provider_overridden, 0, (char *)"Return tuple of overriding providers.", 0},
{(char *)"last_overriding", __pyx_getprop_19dependency_injector_9providers_8Provider_last_overriding, 0, (char *)"Return last overriding provider.\n\n If provider is not overridden, then None is returned.\n ", 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Provider = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Provider", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Provider), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Provider, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
__pyx_pw_19dependency_injector_9providers_8Provider_7__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Base provider class.\n\n :py:class:`Provider` is callable (implements ``__call__`` method). Every\n call to provider object returns provided result, according to the providing\n strategy of particular provider. This ``callable`` functionality is a\n regular part of providers API and it should be the same for all provider's\n subclasses.\n\n Implementation of particular providing strategy should be done in\n :py:meth:`Provider._provide` of :py:class:`Provider` subclass. Current\n method is called every time when not overridden provider is called.\n\n :py:class:`Provider` implements provider overriding logic that should be\n also common for all providers:\n\n .. code-block:: python\n\n provider1 = Factory(SomeClass)\n provider2 = Factory(ChildSomeClass)\n\n provider1.override(provider2)\n\n some_instance = provider1()\n assert isinstance(some_instance, ChildSomeClass)\n\n Also :py:class:`Provider` implements helper function for creating its\n delegates:\n\n .. code-block:: python\n\n provider = Factory(object)\n delegate = provider.delegate()\n\n delegated = delegate()\n\n assert provider is delegated\n\n All providers should extend this class.\n\n .. py:attribute:: overridden\n\n Tuple of overriding providers, if any.\n\n :type: tuple[:py:class:`Provider`] | None\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Provider, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Provider, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Provider, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_19dependency_injector_9providers_Provider, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_8Provider_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Provider, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Object __pyx_vtable_19dependency_injector_9providers_Object;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Object(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Object *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Object *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Object;
p->__pyx___provides = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Object(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Object *p = (struct __pyx_obj_19dependency_injector_9providers_Object *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___provides);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Object(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Object *p = (struct __pyx_obj_19dependency_injector_9providers_Object *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___provides) {
e = (*v)(p->__pyx___provides, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Object(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Object *p = (struct __pyx_obj_19dependency_injector_9providers_Object *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___provides);
p->__pyx___provides = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Object[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_6Object_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_6Object_2__deepcopy__},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_6Object_9_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_6Object_8_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Object = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Object", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Object), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Object, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_19dependency_injector_9providers_6Object_7__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
__pyx_pw_19dependency_injector_9providers_6Object_5__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Object provider returns provided instance \"as is\".\n\n .. py:attribute:: provides\n\n Value that have to be provided.\n\n :type: object\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Object, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Object, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Object, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_6Object_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Object, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Delegate __pyx_vtable_19dependency_injector_9providers_Delegate;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Delegate(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Delegate *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Object(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Delegate *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Delegate;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Delegate[] = {
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Delegate = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Delegate", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Delegate), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Object, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_7__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Delegate provider returns provider \"as is\".\n\n .. py:attribute:: provides\n\n Value that have to be provided.\n\n :type: object\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Object, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Object, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Delegate, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_8Delegate_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Delegate, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ExternalDependency __pyx_vtable_19dependency_injector_9providers_ExternalDependency;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ExternalDependency(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_ExternalDependency;
p->__pyx___instance_of = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_ExternalDependency(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *p = (struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___instance_of);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_ExternalDependency(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *p = (struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___instance_of) {
e = (*v)(p->__pyx___instance_of, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_ExternalDependency(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *p = (struct __pyx_obj_19dependency_injector_9providers_ExternalDependency *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___instance_of);
p->__pyx___instance_of = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_18ExternalDependency_instance_of(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_18ExternalDependency_11instance_of_1__get__(o);
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_ExternalDependency[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_18ExternalDependency_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_18ExternalDependency_2__deepcopy__},
{"provided_by", (PyCFunction)__pyx_pw_19dependency_injector_9providers_18ExternalDependency_11provided_by, METH_O, __pyx_doc_19dependency_injector_9providers_18ExternalDependency_10provided_by},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_19dependency_injector_9providers_ExternalDependency[] = {
{(char *)"instance_of", __pyx_getprop_19dependency_injector_9providers_18ExternalDependency_instance_of, 0, (char *)"Return class of required dependency.", 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_ExternalDependency = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.ExternalDependency", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_ExternalDependency), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_ExternalDependency, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
__pyx_pw_19dependency_injector_9providers_18ExternalDependency_9__repr__, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pw_19dependency_injector_9providers_18ExternalDependency_5__call__, /*tp_call*/
__pyx_pw_19dependency_injector_9providers_18ExternalDependency_7__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
":py:class:`ExternalDependency` provider describes dependency interface.\n\n This provider is used for description of dependency interface. That might\n be useful when dependency could be provided in the client's code only,\n but it's interface is known. Such situations could happen when required\n dependency has non-determenistic list of dependencies itself.\n\n .. code-block:: python\n\n database_provider = ExternalDependency(sqlite3.dbapi2.Connection)\n database_provider.override(Factory(sqlite3.connect, ':memory:'))\n\n database = database_provider()\n\n .. py:attribute:: instance_of\n\n Class of required dependency.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_ExternalDependency, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_ExternalDependency, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_ExternalDependency, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_19dependency_injector_9providers_ExternalDependency, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_18ExternalDependency_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_ExternalDependency, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_19dependency_injector_9providers_OverridingContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_OverridingContext *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)o);
p->__pyx___overridden = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
p->__pyx___overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_OverridingContext(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_OverridingContext *p = (struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___overridden);
Py_CLEAR(p->__pyx___overriding);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_OverridingContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_OverridingContext *p = (struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)o;
if (p->__pyx___overridden) {
e = (*v)(((PyObject*)p->__pyx___overridden), a); if (e) return e;
}
if (p->__pyx___overriding) {
e = (*v)(((PyObject*)p->__pyx___overriding), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_OverridingContext(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_OverridingContext *p = (struct __pyx_obj_19dependency_injector_9providers_OverridingContext *)o;
tmp = ((PyObject*)p->__pyx___overridden);
p->__pyx___overridden = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___overriding);
p->__pyx___overriding = ((struct __pyx_obj_19dependency_injector_9providers_Provider *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_OverridingContext[] = {
{"__enter__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_17OverridingContext_3__enter__, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_17OverridingContext_2__enter__},
{"__exit__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_17OverridingContext_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_17OverridingContext_4__exit__},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_OverridingContext = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.OverridingContext", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_OverridingContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_OverridingContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Provider overriding context.\n\n :py:class:`OverridingContext` is used by :py:meth:`Provider.override` for\n implemeting ``with`` contexts. When :py:class:`OverridingContext` is\n closed, overriding that was created in this context is dropped also.\n\n .. code-block:: python\n\n with provider.override(another_provider):\n assert provider.overridden\n assert not provider.overridden\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_OverridingContext, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_OverridingContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_OverridingContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_17OverridingContext_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_OverridingContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Callable __pyx_vtable_19dependency_injector_9providers_Callable;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Callable(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Callable *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Callable *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Callable;
p->__pyx___provides = Py_None; Py_INCREF(Py_None);
p->__pyx___args = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->__pyx___kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Callable(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Callable *p = (struct __pyx_obj_19dependency_injector_9providers_Callable *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___provides);
Py_CLEAR(p->__pyx___args);
Py_CLEAR(p->__pyx___kwargs);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Callable(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Callable *p = (struct __pyx_obj_19dependency_injector_9providers_Callable *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___provides) {
e = (*v)(p->__pyx___provides, a); if (e) return e;
}
if (p->__pyx___args) {
e = (*v)(p->__pyx___args, a); if (e) return e;
}
if (p->__pyx___kwargs) {
e = (*v)(p->__pyx___kwargs, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Callable(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Callable *p = (struct __pyx_obj_19dependency_injector_9providers_Callable *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___provides);
p->__pyx___provides = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___args);
p->__pyx___args = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___kwargs);
p->__pyx___kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_8Callable_provides(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_8Callable_8provides_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_8Callable_args(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_8Callable_4args_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_8Callable_kwargs(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_8Callable_6kwargs_1__get__(o);
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Callable[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_8Callable_2__deepcopy__},
{"add_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_7add_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Callable_6add_args},
{"set_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_9set_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Callable_8set_args},
{"clear_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_11clear_args, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_8Callable_10clear_args},
{"add_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_13add_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Callable_12add_kwargs},
{"set_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_15set_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Callable_14set_kwargs},
{"clear_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_17clear_kwargs, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_8Callable_16clear_kwargs},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_8Callable_19_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_8Callable_18_provide},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_19dependency_injector_9providers_Callable[] = {
{(char *)"provides", __pyx_getprop_19dependency_injector_9providers_8Callable_provides, 0, (char *)"Return wrapped callable.", 0},
{(char *)"args", __pyx_getprop_19dependency_injector_9providers_8Callable_args, 0, (char *)"Return positional argument injections.", 0},
{(char *)"kwargs", __pyx_getprop_19dependency_injector_9providers_8Callable_kwargs, 0, (char *)"Return keyword argument injections.", 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Callable = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Callable", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Callable), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Callable, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
__pyx_pw_19dependency_injector_9providers_8Callable_5__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Callable provider calls wrapped callable on every call.\n\n Callable supports positional and keyword argument injections:\n\n .. code-block:: python\n\n some_function = Callable(some_function,\n 'positional_arg1', 'positional_arg2',\n keyword_argument1=3, keyword_argument=4)\n\n # or\n\n some_function = Callable(some_function) \\\n .add_args('positional_arg1', 'positional_arg2') \\\n .add_kwargs(keyword_argument1=3, keyword_argument=4)\n\n # or\n\n some_function = Callable(some_function)\n some_function.add_args('positional_arg1', 'positional_arg2')\n some_function.add_kwargs(keyword_argument1=3, keyword_argument=4)\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Callable, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Callable, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Callable, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_19dependency_injector_9providers_Callable, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_8Callable_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Callable, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedCallable __pyx_vtable_19dependency_injector_9providers_DelegatedCallable;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedCallable(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Callable(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable;
return o;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_DelegatedCallable = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.DelegatedCallable", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedCallable), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Callable, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Callable_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Callable that is injected \"as is\".\n\n DelegatedCallable is a :py:class:`Callable`, that is injected \"as is\".\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Callable, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Callable, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Callable_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_DelegatedCallable, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
2017-04-06 18:17:06 +03:00
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractCallable __pyx_vtable_19dependency_injector_9providers_AbstractCallable;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractCallable(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Callable(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_AbstractCallable *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_AbstractCallable[] = {
{"override", (PyCFunction)__pyx_pw_19dependency_injector_9providers_16AbstractCallable_3override, METH_O, __pyx_doc_19dependency_injector_9providers_16AbstractCallable_2override},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_16AbstractCallable_5_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_16AbstractCallable_4_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_AbstractCallable = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.AbstractCallable", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractCallable), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Callable, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pw_19dependency_injector_9providers_16AbstractCallable_1__call__, /*tp_call*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Callable_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Abstract callable provider.\n\n :py:class:`AbstractCallable` is a :py:class:`Callable` provider that must\n be explicitly overridden before calling.\n\n Overriding of :py:class:`AbstractCallable` is possible only by another\n :py:class:`Callable` provider.\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Callable, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Callable, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_AbstractCallable, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Callable_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_AbstractCallable, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
2017-07-09 23:29:33 +03:00
static struct __pyx_vtabstruct_19dependency_injector_9providers_CallableDelegate __pyx_vtable_19dependency_injector_9providers_CallableDelegate;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_CallableDelegate(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_CallableDelegate *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Delegate(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_CallableDelegate *)o);
p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_CallableDelegate;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_CallableDelegate[] = {
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_CallableDelegate = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.CallableDelegate", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_CallableDelegate), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Object, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_7__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Callable delegate injects delegating callable \"as is\".\n\n .. py:attribute:: provides\n\n Value that have to be provided.\n\n :type: object\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Object, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Object, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_CallableDelegate, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_16CallableDelegate_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_CallableDelegate, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Configuration __pyx_vtable_19dependency_injector_9providers_Configuration;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Configuration(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Configuration *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Configuration *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Configuration;
p->__pyx___name = ((PyObject*)Py_None); Py_INCREF(Py_None);
p->__pyx___value = Py_None; Py_INCREF(Py_None);
p->__pyx___children = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Configuration(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Configuration *p = (struct __pyx_obj_19dependency_injector_9providers_Configuration *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___name);
Py_CLEAR(p->__pyx___value);
Py_CLEAR(p->__pyx___children);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Configuration(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Configuration *p = (struct __pyx_obj_19dependency_injector_9providers_Configuration *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___value) {
e = (*v)(p->__pyx___value, a); if (e) return e;
}
if (p->__pyx___children) {
e = (*v)(p->__pyx___children, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Configuration(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Configuration *p = (struct __pyx_obj_19dependency_injector_9providers_Configuration *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___value);
p->__pyx___value = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___children);
p->__pyx___children = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_tp_getattro_19dependency_injector_9providers_Configuration(PyObject *o, PyObject *n) {
PyObject *v = PyObject_GenericGetAttr(o, n);
if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Clear();
v = __pyx_pw_19dependency_injector_9providers_13Configuration_7__getattr__(o, n);
}
return v;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Configuration[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_13Configuration_2__deepcopy__},
{"__getattr__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_7__getattr__, METH_O|METH_COEXIST, __pyx_doc_19dependency_injector_9providers_13Configuration_6__getattr__},
{"get_name", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_9get_name, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_13Configuration_8get_name},
{"update", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_11update, METH_O, __pyx_doc_19dependency_injector_9providers_13Configuration_10update},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_13_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13Configuration_12_provide},
{"_get_child_name", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13Configuration_15_get_child_name, METH_O, 0},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Configuration = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Configuration", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Configuration), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Configuration, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
__pyx_pw_19dependency_injector_9providers_13Configuration_5__str__, /*tp_str*/
__pyx_tp_getattro_19dependency_injector_9providers_Configuration, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Configuration provider.\n\n Configuration provider helps with implementing late static binding of\n configuration options - use first, define later.\n\n .. code-block:: python\n\n config = Configuration('config')\n\n print(config.section1.option1()) # None\n print(config.section1.option2()) # None\n\n config.update({'section1': {'option1': 1,\n 'option2': 2}})\n\n print(config.section1.option1()) # 1\n print(config.section1.option2()) # 2\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Configuration, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Configuration, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Configuration, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_13Configuration_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Configuration, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Factory __pyx_vtable_19dependency_injector_9providers_Factory;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Factory(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Factory *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Factory *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Factory;
p->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Callable *)Py_None); Py_INCREF(Py_None);
p->__pyx___attributes = ((PyObject*)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Factory(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Factory *p = (struct __pyx_obj_19dependency_injector_9providers_Factory *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___instantiator);
Py_CLEAR(p->__pyx___attributes);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Factory(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Factory *p = (struct __pyx_obj_19dependency_injector_9providers_Factory *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___instantiator) {
e = (*v)(((PyObject*)p->__pyx___instantiator), a); if (e) return e;
}
if (p->__pyx___attributes) {
e = (*v)(p->__pyx___attributes, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Factory(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Factory *p = (struct __pyx_obj_19dependency_injector_9providers_Factory *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___instantiator);
p->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Callable *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___attributes);
p->__pyx___attributes = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_7Factory_cls(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_7Factory_3cls_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_7Factory_args(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_7Factory_4args_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_7Factory_kwargs(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_7Factory_6kwargs_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_7Factory_attributes(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_7Factory_10attributes_1__get__(o);
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Factory[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_7Factory_2__deepcopy__},
{"add_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_7add_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_6add_args},
{"set_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_9set_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_8set_args},
{"clear_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_11clear_args, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_7Factory_10clear_args},
{"add_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_13add_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_12add_kwargs},
{"set_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_15set_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_14set_kwargs},
{"clear_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_17clear_kwargs, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_7Factory_16clear_kwargs},
{"add_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_19add_attributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_18add_attributes},
{"set_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_21set_attributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_20set_attributes},
{"clear_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_23clear_attributes, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_7Factory_22clear_attributes},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7Factory_25_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_7Factory_24_provide},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_19dependency_injector_9providers_Factory[] = {
{(char *)"cls", __pyx_getprop_19dependency_injector_9providers_7Factory_cls, 0, (char *)"Return provided type.", 0},
{(char *)"args", __pyx_getprop_19dependency_injector_9providers_7Factory_args, 0, (char *)"Return positional argument injections.", 0},
{(char *)"kwargs", __pyx_getprop_19dependency_injector_9providers_7Factory_kwargs, 0, (char *)"Return keyword argument injections.", 0},
{(char *)"attributes", __pyx_getprop_19dependency_injector_9providers_7Factory_attributes, 0, (char *)"Return attribute injections.", 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Factory = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Factory", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Factory), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Factory, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
__pyx_pw_19dependency_injector_9providers_7Factory_5__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Factory provider creates new instance on every call.\n\n :py:class:`Factory` supports positional & keyword argument injections,\n as well as attribute injections.\n\n Positional and keyword argument injections could be defined like this:\n\n .. code-block:: python\n\n factory = Factory(SomeClass,\n 'positional_arg1', 'positional_arg2',\n keyword_argument1=3, keyword_argument=4)\n\n # or\n\n factory = Factory(SomeClass) \\\n .add_args('positional_arg1', 'positional_arg2') \\\n .add_kwargs(keyword_argument1=3, keyword_argument=4)\n\n # or\n\n factory = Factory(SomeClass)\n factory.add_args('positional_arg1', 'positional_arg2')\n factory.add_kwargs(keyword_argument1=3, keyword_argument=4)\n\n\n Attribute injections are defined by using\n :py:meth:`Factory.add_attributes`:\n\n .. code-block:: python\n\n factory = Factory(SomeClass) \\\n .add_attributes(attribute1=1, attribute2=2)\n\n Retrieving of provided instance can be performed via calling\n :py:class:`Factory` object:\n\n .. code-block:: python\n\n factory = Factory(SomeClass)\n some_object = factory()\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Factory, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Factory, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Factory, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_19dependency_injector_9providers_Factory, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_7Factory_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Factory, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedFactory __pyx_vtable_19dependency_injector_9providers_DelegatedFactory;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Factory(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory;
return o;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_DelegatedFactory = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.DelegatedFactory", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedFactory), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Factory, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_7Factory_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Factory that is injected \"as is\".\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Factory, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Factory, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_7Factory_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_DelegatedFactory, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
2017-04-06 18:17:06 +03:00
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractFactory __pyx_vtable_19dependency_injector_9providers_AbstractFactory;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Factory(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_AbstractFactory *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_AbstractFactory[] = {
{"override", (PyCFunction)__pyx_pw_19dependency_injector_9providers_15AbstractFactory_3override, METH_O, __pyx_doc_19dependency_injector_9providers_15AbstractFactory_2override},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_15AbstractFactory_5_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_15AbstractFactory_4_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_AbstractFactory = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.AbstractFactory", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractFactory), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Factory, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pw_19dependency_injector_9providers_15AbstractFactory_1__call__, /*tp_call*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_7Factory_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Abstract factory provider.\n\n :py:class:`AbstractFactory` is a :py:class:`Factory` provider that must\n be explicitly overridden before calling.\n\n Overriding of :py:class:`AbstractFactory` is possible only by another\n :py:class:`Factory` provider.\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Factory, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Factory, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_AbstractFactory, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_7Factory_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_AbstractFactory, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
2017-07-09 23:13:10 +03:00
static struct __pyx_vtabstruct_19dependency_injector_9providers_FactoryDelegate __pyx_vtable_19dependency_injector_9providers_FactoryDelegate;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_FactoryDelegate(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Delegate(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate *)o);
p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_FactoryDelegate[] = {
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_FactoryDelegate = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.FactoryDelegate", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_FactoryDelegate), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Object, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_7__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_6Object_5__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Factory delegate injects delegating factory \"as is\".\n\n .. py:attribute:: provides\n\n Value that have to be provided.\n\n :type: object\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Object, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Object, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_FactoryDelegate, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_15FactoryDelegate_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_FactoryDelegate, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_BaseSingleton __pyx_vtable_19dependency_injector_9providers_BaseSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_BaseSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Provider(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)o);
p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
p->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Factory *)Py_None); Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___instantiator);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Provider(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Provider(o, v, a); if (e) return e;
if (p->__pyx___instantiator) {
e = (*v)(((PyObject*)p->__pyx___instantiator), a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_BaseSingleton(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_BaseSingleton *)o;
__pyx_tp_clear_19dependency_injector_9providers_Provider(o);
tmp = ((PyObject*)p->__pyx___instantiator);
p->__pyx___instantiator = ((struct __pyx_obj_19dependency_injector_9providers_Factory *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_13BaseSingleton_cls(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_13BaseSingleton_3cls_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_13BaseSingleton_args(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_13BaseSingleton_4args_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_13BaseSingleton_kwargs(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_13BaseSingleton_6kwargs_1__get__(o);
}
static PyObject *__pyx_getprop_19dependency_injector_9providers_13BaseSingleton_attributes(PyObject *o, CYTHON_UNUSED void *x) {
return __pyx_pw_19dependency_injector_9providers_13BaseSingleton_10attributes_1__get__(o);
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_BaseSingleton[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_5__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_4__deepcopy__},
{"add_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_7add_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_6add_args},
{"set_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_9set_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_8set_args},
{"clear_args", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_11clear_args, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_10clear_args},
{"add_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_13add_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_12add_kwargs},
{"set_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_15set_kwargs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_14set_kwargs},
{"clear_kwargs", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_17clear_kwargs, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_16clear_kwargs},
{"add_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_19add_attributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_18add_attributes},
{"set_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_21set_attributes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_20set_attributes},
{"clear_attributes", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_23clear_attributes, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_22clear_attributes},
{"reset", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13BaseSingleton_25reset, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_13BaseSingleton_24reset},
{0, 0, 0, 0}
};
static struct PyGetSetDef __pyx_getsets_19dependency_injector_9providers_BaseSingleton[] = {
{(char *)"cls", __pyx_getprop_19dependency_injector_9providers_13BaseSingleton_cls, 0, (char *)"Return provided type.", 0},
{(char *)"args", __pyx_getprop_19dependency_injector_9providers_13BaseSingleton_args, 0, (char *)"Return positional argument injections.", 0},
{(char *)"kwargs", __pyx_getprop_19dependency_injector_9providers_13BaseSingleton_kwargs, 0, (char *)"Return keyword argument injections.", 0},
{(char *)"attributes", __pyx_getprop_19dependency_injector_9providers_13BaseSingleton_attributes, 0, (char *)"Return attribute injections.", 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_BaseSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.BaseSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_BaseSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Base class of singleton providers.", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_BaseSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_BaseSingleton, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_19dependency_injector_9providers_BaseSingleton, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_BaseSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_Singleton __pyx_vtable_19dependency_injector_9providers_Singleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Singleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Singleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_BaseSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Singleton *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_Singleton;
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Singleton(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Singleton *p = (struct __pyx_obj_19dependency_injector_9providers_Singleton *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___storage);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Singleton(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Singleton *p = (struct __pyx_obj_19dependency_injector_9providers_Singleton *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton(o, v, a); if (e) return e;
if (p->__pyx___storage) {
e = (*v)(p->__pyx___storage, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Singleton(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Singleton *p = (struct __pyx_obj_19dependency_injector_9providers_Singleton *)o;
__pyx_tp_clear_19dependency_injector_9providers_BaseSingleton(o);
tmp = ((PyObject*)p->__pyx___storage);
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_Singleton[] = {
{"reset", (PyCFunction)__pyx_pw_19dependency_injector_9providers_9Singleton_3reset, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_9Singleton_2reset},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_9Singleton_5_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_9Singleton_4_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_Singleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Singleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Singleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Singleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Singleton provider returns same instance on every call.\n\n :py:class:`Singleton` provider creates instance once and returns it on\n every call. :py:class:`Singleton` extends :py:class:`Factory`, so, please\n follow :py:class:`Factory` documentation for getting familiar with\n injections syntax.\n\n Retrieving of provided instance can be performed via calling\n :py:class:`Singleton` object:\n\n .. code-block:: python\n\n singleton = Singleton(SomeClass)\n some_object = singleton()\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Singleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Singleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_Singleton, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_9Singleton_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Singleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedSingleton __pyx_vtable_19dependency_injector_9providers_DelegatedSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Singleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton;
return o;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_DelegatedSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.DelegatedSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Singleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Delegated singleton is injected \"as is\".\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Singleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Singleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_9Singleton_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_DelegatedSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadSafeSingleton __pyx_vtable_19dependency_injector_9providers_ThreadSafeSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ThreadSafeSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_BaseSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton;
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
p->__pyx___storage_lock = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_ThreadSafeSingleton(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___storage);
Py_CLEAR(p->__pyx___storage_lock);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_ThreadSafeSingleton(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton(o, v, a); if (e) return e;
if (p->__pyx___storage) {
e = (*v)(p->__pyx___storage, a); if (e) return e;
}
if (p->__pyx___storage_lock) {
e = (*v)(p->__pyx___storage_lock, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_ThreadSafeSingleton(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton *)o;
__pyx_tp_clear_19dependency_injector_9providers_BaseSingleton(o);
tmp = ((PyObject*)p->__pyx___storage);
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx___storage_lock);
p->__pyx___storage_lock = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_ThreadSafeSingleton[] = {
{"reset", (PyCFunction)__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_3reset, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton_2reset},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_5_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton_4_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_ThreadSafeSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.ThreadSafeSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadSafeSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Thread-safe singleton provider.", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadSafeSingleton __pyx_vtable_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadSafeSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_ThreadSafeSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
return o;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.DelegatedThreadSafeSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadSafeSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Delegated thread-safe singleton is injected \"as is\".\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_ThreadSafeSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_19ThreadSafeSingleton_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadSafeSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_ThreadLocalSingleton __pyx_vtable_19dependency_injector_9providers_ThreadLocalSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_ThreadLocalSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_BaseSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton;
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_ThreadLocalSingleton(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___storage);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_ThreadLocalSingleton(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton(o, v, a); if (e) return e;
if (p->__pyx___storage) {
e = (*v)(p->__pyx___storage, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_ThreadLocalSingleton(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *p = (struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton *)o;
__pyx_tp_clear_19dependency_injector_9providers_BaseSingleton(o);
tmp = ((PyObject*)p->__pyx___storage);
p->__pyx___storage = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_ThreadLocalSingleton[] = {
{"reset", (PyCFunction)__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_3reset, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton_2reset},
{"_provide", (PyCFunction)__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_5_provide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton_4_provide},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_ThreadLocalSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.ThreadLocalSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_ThreadLocalSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Thread-local singleton provides single objects in scope of thread.\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static struct __pyx_vtabstruct_19dependency_injector_9providers_DelegatedThreadLocalSingleton __pyx_vtable_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadLocalSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_ThreadLocalSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
return o;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.DelegatedThreadLocalSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_DelegatedThreadLocalSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_3__call__, /*tp_call*/
#else
0, /*tp_call*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Delegated thread-local singleton is injected \"as is\".\n\n .. py:attribute:: provided_type\n\n If provided type is defined, provider checks that providing class is\n its subclass.\n\n :type: type | None\n\n .. py:attribute:: cls\n\n Class that provides object.\n Alias for :py:attr:`provides`.\n\n :type: type\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_ThreadLocalSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_20ThreadLocalSingleton_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_DelegatedThreadLocalSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
2017-04-06 18:17:06 +03:00
static struct __pyx_vtabstruct_19dependency_injector_9providers_AbstractSingleton __pyx_vtable_19dependency_injector_9providers_AbstractSingleton;
static PyObject *__pyx_tp_new_19dependency_injector_9providers_AbstractSingleton(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_BaseSingleton(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton *)o);
p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_19dependency_injector_9providers_Provider*)__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_AbstractSingleton[] = {
{"override", (PyCFunction)__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_3override, METH_O, __pyx_doc_19dependency_injector_9providers_17AbstractSingleton_2override},
{"reset", (PyCFunction)__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_5reset, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_17AbstractSingleton_4reset},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_AbstractSingleton = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.AbstractSingleton", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_AbstractSingleton), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_BaseSingleton, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_8Provider_9__repr__, /*tp_repr*/
#else
0, /*tp_repr*/
#endif
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pw_19dependency_injector_9providers_17AbstractSingleton_1__call__, /*tp_call*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_3__str__, /*tp_str*/
#else
0, /*tp_str*/
#endif
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Abstract singleton provider.\n\n :py:class:`AbstractSingleton` is a :py:class:`Singleton` provider that must\n be explicitly overridden before calling.\n\n Overriding of :py:class:`AbstractSingleton` is possible only by another\n :py:class:`BaseSingleton` provider.\n ", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_BaseSingleton, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_BaseSingleton, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_AbstractSingleton, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
#if CYTHON_COMPILING_IN_PYPY
__pyx_pw_19dependency_injector_9providers_13BaseSingleton_1__init__, /*tp_init*/
#else
0, /*tp_init*/
#endif
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_AbstractSingleton, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_19dependency_injector_9providers_Injection(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_Injection *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
} else {
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_Injection *)o);
p->__pyx___value = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_Injection(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_Injection *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___value);
(*Py_TYPE(o)->tp_free)(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_Injection(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_Injection *)o;
if (p->__pyx___value) {
e = (*v)(p->__pyx___value, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_Injection(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_Injection *p = (struct __pyx_obj_19dependency_injector_9providers_Injection *)o;
tmp = ((PyObject*)p->__pyx___value);
p->__pyx___value = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyTypeObject __pyx_type_19dependency_injector_9providers_Injection = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.Injection", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_Injection), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Injection, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Abstract injection class.", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Injection, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Injection, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
0, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_Injection, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_19dependency_injector_9providers_PositionalInjection(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Injection(t, a, k);
if (unlikely(!o)) return 0;
return o;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_PositionalInjection[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_19PositionalInjection_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_19PositionalInjection_2__deepcopy__},
{"get_value", (PyCFunction)__pyx_pw_19dependency_injector_9providers_19PositionalInjection_5get_value, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_19PositionalInjection_4get_value},
{"get_original_value", (PyCFunction)__pyx_pw_19dependency_injector_9providers_19PositionalInjection_7get_original_value, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_19PositionalInjection_6get_original_value},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_PositionalInjection = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.PositionalInjection", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_PositionalInjection), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_Injection, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Positional injection class.", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_Injection, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_Injection, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_PositionalInjection, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_19PositionalInjection_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_PositionalInjection, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyObject *__pyx_tp_new_19dependency_injector_9providers_NamedInjection(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *p;
PyObject *o = __pyx_tp_new_19dependency_injector_9providers_Injection(t, a, k);
if (unlikely(!o)) return 0;
p = ((struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)o);
p->__pyx___name = Py_None; Py_INCREF(Py_None);
return o;
}
static void __pyx_tp_dealloc_19dependency_injector_9providers_NamedInjection(PyObject *o) {
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *p = (struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)o;
#if PY_VERSION_HEX >= 0x030400a1
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
if (PyObject_CallFinalizerFromDealloc(o)) return;
}
#endif
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx___name);
PyObject_GC_Track(o);
__pyx_tp_dealloc_19dependency_injector_9providers_Injection(o);
}
static int __pyx_tp_traverse_19dependency_injector_9providers_NamedInjection(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *p = (struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)o;
e = __pyx_tp_traverse_19dependency_injector_9providers_Injection(o, v, a); if (e) return e;
if (p->__pyx___name) {
e = (*v)(p->__pyx___name, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_19dependency_injector_9providers_NamedInjection(PyObject *o) {
PyObject* tmp;
struct __pyx_obj_19dependency_injector_9providers_NamedInjection *p = (struct __pyx_obj_19dependency_injector_9providers_NamedInjection *)o;
__pyx_tp_clear_19dependency_injector_9providers_Injection(o);
tmp = ((PyObject*)p->__pyx___name);
p->__pyx___name = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
static PyMethodDef __pyx_methods_19dependency_injector_9providers_NamedInjection[] = {
{"__deepcopy__", (PyCFunction)__pyx_pw_19dependency_injector_9providers_14NamedInjection_3__deepcopy__, METH_O, __pyx_doc_19dependency_injector_9providers_14NamedInjection_2__deepcopy__},
{"get_name", (PyCFunction)__pyx_pw_19dependency_injector_9providers_14NamedInjection_5get_name, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_14NamedInjection_4get_name},
{"get_value", (PyCFunction)__pyx_pw_19dependency_injector_9providers_14NamedInjection_7get_value, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_14NamedInjection_6get_value},
{"get_original_value", (PyCFunction)__pyx_pw_19dependency_injector_9providers_14NamedInjection_9get_original_value, METH_NOARGS, __pyx_doc_19dependency_injector_9providers_14NamedInjection_8get_original_value},
{0, 0, 0, 0}
};
static PyTypeObject __pyx_type_19dependency_injector_9providers_NamedInjection = {
PyVarObject_HEAD_INIT(0, 0)
"dependency_injector.providers.NamedInjection", /*tp_name*/
sizeof(struct __pyx_obj_19dependency_injector_9providers_NamedInjection), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_19dependency_injector_9providers_NamedInjection, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
#endif
#if PY_MAJOR_VERSION >= 3
0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Keyword injection class.", /*tp_doc*/
__pyx_tp_traverse_19dependency_injector_9providers_NamedInjection, /*tp_traverse*/
__pyx_tp_clear_19dependency_injector_9providers_NamedInjection, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_19dependency_injector_9providers_NamedInjection, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pw_19dependency_injector_9providers_14NamedInjection_1__init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_19dependency_injector_9providers_NamedInjection, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
0, /*tp_del*/
0, /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
};
static PyMethodDef __pyx_methods[] = {
{"parse_positional_injections", (PyCFunction)__pyx_pw_19dependency_injector_9providers_1parse_positional_injections, METH_O, __pyx_doc_19dependency_injector_9providers_parse_positional_injections},
{"parse_named_injections", (PyCFunction)__pyx_pw_19dependency_injector_9providers_3parse_named_injections, METH_O, __pyx_doc_19dependency_injector_9providers_2parse_named_injections},
{"is_provider", (PyCFunction)__pyx_pw_19dependency_injector_9providers_5is_provider, METH_O, __pyx_doc_19dependency_injector_9providers_4is_provider},
{"ensure_is_provider", (PyCFunction)__pyx_pw_19dependency_injector_9providers_7ensure_is_provider, METH_O, __pyx_doc_19dependency_injector_9providers_6ensure_is_provider},
{"is_delegated", (PyCFunction)__pyx_pw_19dependency_injector_9providers_9is_delegated, METH_O, __pyx_doc_19dependency_injector_9providers_8is_delegated},
{"represent_provider", (PyCFunction)__pyx_pw_19dependency_injector_9providers_11represent_provider, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_10represent_provider},
{"deepcopy", (PyCFunction)__pyx_pw_19dependency_injector_9providers_13deepcopy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_19dependency_injector_9providers_12deepcopy},
{0, 0, 0, 0}
};
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
#if PY_VERSION_HEX < 0x03020000
{ PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
#else
PyModuleDef_HEAD_INIT,
#endif
"providers",
__pyx_k_Dependency_injector_providers_Po, /* m_doc */
-1, /* m_size */
__pyx_methods /* m_methods */,
NULL, /* m_reload */
NULL, /* m_traverse */
NULL, /* m_clear */
NULL /* m_free */
};
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_0_can_provide_only_1_instances, __pyx_k_0_can_provide_only_1_instances, sizeof(__pyx_k_0_can_provide_only_1_instances), 0, 0, 1, 0},
2017-07-09 23:13:10 +03:00
{&__pyx_kp_s_0_can_wrap_only_1_providers, __pyx_k_0_can_wrap_only_1_providers, sizeof(__pyx_k_0_can_wrap_only_1_providers), 0, 0, 1, 0},
{&__pyx_kp_s_0_is_not_an, __pyx_k_0_is_not_an, sizeof(__pyx_k_0_is_not_an), 0, 0, 1, 0},
2017-04-06 18:17:06 +03:00
{&__pyx_kp_s_0_must_be_overridden_before_cal, __pyx_k_0_must_be_overridden_before_cal, sizeof(__pyx_k_0_must_be_overridden_before_cal), 0, 0, 1, 0},
{&__pyx_kp_s_0_must_be_overridden_only_by_1, __pyx_k_0_must_be_overridden_only_by_1, sizeof(__pyx_k_0_must_be_overridden_only_by_1), 0, 0, 1, 0},
{&__pyx_kp_s_Abstract_provider_forward_provid, __pyx_k_Abstract_provider_forward_provid, sizeof(__pyx_k_Abstract_provider_forward_provid), 0, 0, 1, 0},
{&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
{&__pyx_n_s_CLASS_TYPES, __pyx_k_CLASS_TYPES, sizeof(__pyx_k_CLASS_TYPES), 0, 0, 1, 1},
{&__pyx_n_s_ClassType, __pyx_k_ClassType, sizeof(__pyx_k_ClassType), 0, 0, 1, 1},
{&__pyx_kp_s_Dependency_is_not_defined, __pyx_k_Dependency_is_not_defined, sizeof(__pyx_k_Dependency_is_not_defined), 0, 0, 1, 0},
{&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
{&__pyx_kp_s_Expected_provider_instance_got_0, __pyx_k_Expected_provider_instance_got_0, sizeof(__pyx_k_Expected_provider_instance_got_0), 0, 0, 1, 0},
{&__pyx_n_s_IS_DELEGATED, __pyx_k_IS_DELEGATED, sizeof(__pyx_k_IS_DELEGATED), 0, 0, 1, 1},
{&__pyx_n_s_IS_PROVIDER, __pyx_k_IS_PROVIDER, sizeof(__pyx_k_IS_PROVIDER), 0, 0, 1, 1},
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
{&__pyx_n_s_MethodType, __pyx_k_MethodType, sizeof(__pyx_k_MethodType), 0, 0, 1, 1},
{&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
{&__pyx_kp_s_Provider_0_could_not_be_overridd, __pyx_k_Provider_0_could_not_be_overridd, sizeof(__pyx_k_Provider_0_could_not_be_overridd), 0, 0, 1, 0},
{&__pyx_kp_s_Provider_0_expected_to_get_calla, __pyx_k_Provider_0_expected_to_get_calla, sizeof(__pyx_k_Provider_0_expected_to_get_calla), 0, 0, 1, 0},
{&__pyx_kp_s_Provider_0_is_not_overridden, __pyx_k_Provider_0_is_not_overridden, sizeof(__pyx_k_Provider_0_is_not_overridden), 0, 0, 1, 0},
{&__pyx_n_s_RLock, __pyx_k_RLock, sizeof(__pyx_k_RLock), 0, 0, 1, 1},
{&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
{&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
{&__pyx_n_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 1},
{&__pyx_n_s_add_args, __pyx_k_add_args, sizeof(__pyx_k_add_args), 0, 0, 1, 1},
{&__pyx_n_s_add_attributes, __pyx_k_add_attributes, sizeof(__pyx_k_add_attributes), 0, 0, 1, 1},
{&__pyx_n_s_add_kwargs, __pyx_k_add_kwargs, sizeof(__pyx_k_add_kwargs), 0, 0, 1, 1},
{&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
{&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
{&__pyx_n_s_attribute_name, __pyx_k_attribute_name, sizeof(__pyx_k_attribute_name), 0, 0, 1, 1},
{&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1},
2017-07-09 23:29:33 +03:00
{&__pyx_n_s_callable, __pyx_k_callable, sizeof(__pyx_k_callable), 0, 0, 1, 1},
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
{&__pyx_n_s_clear_args, __pyx_k_clear_args, sizeof(__pyx_k_clear_args), 0, 0, 1, 1},
{&__pyx_n_s_clear_attributes, __pyx_k_clear_attributes, sizeof(__pyx_k_clear_attributes), 0, 0, 1, 1},
{&__pyx_n_s_clear_kwargs, __pyx_k_clear_kwargs, sizeof(__pyx_k_clear_kwargs), 0, 0, 1, 1},
{&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
{&__pyx_kp_s_cls_object_has_no_attribute_att, __pyx_k_cls_object_has_no_attribute_att, sizeof(__pyx_k_cls_object_has_no_attribute_att), 0, 0, 1, 0},
{&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
{&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
{&__pyx_n_s_deepcopy_dispatch, __pyx_k_deepcopy_dispatch, sizeof(__pyx_k_deepcopy_dispatch), 0, 0, 1, 1},
{&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
{&__pyx_n_s_dependency_injector_providers, __pyx_k_dependency_injector_providers, sizeof(__pyx_k_dependency_injector_providers), 0, 0, 1, 1},
{&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
{&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
{&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
2017-07-09 23:13:10 +03:00
{&__pyx_n_s_factory, __pyx_k_factory, sizeof(__pyx_k_factory), 0, 0, 1, 1},
{&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
{&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
{&__pyx_n_s_get_child_name, __pyx_k_get_child_name, sizeof(__pyx_k_get_child_name), 0, 0, 1, 1},
{&__pyx_n_s_get_name, __pyx_k_get_name, sizeof(__pyx_k_get_name), 0, 0, 1, 1},
{&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
{&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
{&__pyx_n_s_im_class, __pyx_k_im_class, sizeof(__pyx_k_im_class), 0, 0, 1, 1},
{&__pyx_n_s_im_func, __pyx_k_im_func, sizeof(__pyx_k_im_func), 0, 0, 1, 1},
{&__pyx_n_s_im_self, __pyx_k_im_self, sizeof(__pyx_k_im_self), 0, 0, 1, 1},
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
{&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
{&__pyx_n_s_instance, __pyx_k_instance, sizeof(__pyx_k_instance), 0, 0, 1, 1},
{&__pyx_n_s_instance_of, __pyx_k_instance_of, sizeof(__pyx_k_instance_of), 0, 0, 1, 1},
{&__pyx_kp_s_instance_of_0, __pyx_k_instance_of_0, sizeof(__pyx_k_instance_of_0), 0, 0, 1, 0},
{&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
{&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
{&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
{&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
{&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1},
{&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
{&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
{&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
{&__pyx_n_s_overridden, __pyx_k_overridden, sizeof(__pyx_k_overridden), 0, 0, 1, 1},
{&__pyx_n_s_override, __pyx_k_override, sizeof(__pyx_k_override), 0, 0, 1, 1},
{&__pyx_n_s_overriding, __pyx_k_overriding, sizeof(__pyx_k_overriding), 0, 0, 1, 1},
{&__pyx_n_s_overriding_lock, __pyx_k_overriding_lock, sizeof(__pyx_k_overriding_lock), 0, 0, 1, 1},
{&__pyx_n_s_provide, __pyx_k_provide, sizeof(__pyx_k_provide), 0, 0, 1, 1},
{&__pyx_n_s_provided_type, __pyx_k_provided_type, sizeof(__pyx_k_provided_type), 0, 0, 1, 1},
{&__pyx_n_s_provider, __pyx_k_provider, sizeof(__pyx_k_provider), 0, 0, 1, 1},
{&__pyx_kp_s_provider_provides_at_address, __pyx_k_provider_provides_at_address, sizeof(__pyx_k_provider_provides_at_address), 0, 0, 1, 0},
{&__pyx_n_s_provides, __pyx_k_provides, sizeof(__pyx_k_provides), 0, 0, 1, 1},
{&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
{&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
2017-04-06 18:17:06 +03:00
{&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
{&__pyx_n_s_reset_last_overriding, __pyx_k_reset_last_overriding, sizeof(__pyx_k_reset_last_overriding), 0, 0, 1, 1},
{&__pyx_n_s_set_args, __pyx_k_set_args, sizeof(__pyx_k_set_args), 0, 0, 1, 1},
{&__pyx_n_s_set_attributes, __pyx_k_set_attributes, sizeof(__pyx_k_set_attributes), 0, 0, 1, 1},
{&__pyx_n_s_set_kwargs, __pyx_k_set_kwargs, sizeof(__pyx_k_set_kwargs), 0, 0, 1, 1},
{&__pyx_n_s_storage_lock, __pyx_k_storage_lock, sizeof(__pyx_k_storage_lock), 0, 0, 1, 1},
{&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
{&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
{&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
{&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
{&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
{&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
{&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
2017-07-09 23:29:33 +03:00
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 201, __pyx_L1_error)
__pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 88, __pyx_L1_error)
__pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 101, __pyx_L1_error)
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 179, __pyx_L1_error)
__pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 205, __pyx_L1_error)
2017-07-09 23:29:33 +03:00
__pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 735, __pyx_L1_error)
__pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(1, 1710, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
}
static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
/* "dependency_injector/providers.pyx":129
* def overridden(self):
* """Return tuple of overriding providers."""
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* return self.__overridden
*
*/
__pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
__pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
/* "dependency_injector/providers.pyx":158
* provider = Object(provider)
*
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden += (provider,)
* self.__last_overriding = provider
*/
__pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
/* "dependency_injector/providers.pyx":172
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* if len(self.__overridden) == 0:
* raise Error('Provider {0} is not overridden'.format(str(self)))
*/
__pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
/* "dependency_injector/providers.pyx":187
* :rtype: None
* """
* with self.__overriding_lock: # <<<<<<<<<<<<<<
* self.__overridden = tuple()
* self.__last_overriding = None
*/
__pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
/* "dependency_injector/providers.pyx":343
*
* if self.__last_overriding is None:
* raise Error('Dependency is not defined') # <<<<<<<<<<<<<<
*
* instance = self.__last_overriding._provide(args, kwargs)
*/
__pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Dependency_is_not_defined); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
/* "dependency_injector/providers.pyx":646
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic ' # <<<<<<<<<<<<<<
* 'to overriding provider')
*
*/
__pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Abstract_provider_forward_provid); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1088
2017-04-06 18:17:06 +03:00
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return result of provided callable's call."""
* raise NotImplementedError('Abstract provider forward providing logic ' # <<<<<<<<<<<<<<
* 'to overriding provider')
*
*/
2017-07-09 23:29:33 +03:00
__pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Abstract_provider_forward_provid); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1088, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
2017-04-06 18:17:06 +03:00
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1404
* cpdef object _provide(self, tuple args, dict kwargs):
* """Return single instance."""
* with self.__storage_lock: # <<<<<<<<<<<<<<
* if self.__storage is None:
* self.__storage = __factory_call(self.__instantiator,
*/
2017-07-09 23:29:33 +03:00
__pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
__Pyx_RefNannyFinishContext();
return -1;
}
static int __Pyx_InitGlobals(void) {
__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
__pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
}
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initproviders(void); /*proto*/
PyMODINIT_FUNC initproviders(void)
#else
PyMODINIT_FUNC PyInit_providers(void); /*proto*/
PyMODINIT_FUNC PyInit_providers(void)
#endif
{
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
PyErr_Clear();
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
if (!__Pyx_RefNanny)
Py_FatalError("failed to import 'refnanny' module");
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_providers(void)", 0);
if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_FusedFunction_USED
if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Coroutine_USED
if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_StopAsyncIteration_USED
if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
#ifdef WITH_THREAD /* Python build with threading support? */
PyEval_InitThreads();
#endif
#endif
/*--- Module creation code ---*/
#if PY_MAJOR_VERSION < 3
__pyx_m = Py_InitModule4("providers", __pyx_methods, __pyx_k_Dependency_injector_providers_Po, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
#else
__pyx_m = PyModule_Create(&__pyx_moduledef);
#endif
if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
if (__pyx_module_is_main_dependency_injector__providers) {
if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
if (!PyDict_GetItemString(modules, "dependency_injector.providers")) {
if (unlikely(PyDict_SetItemString(modules, "dependency_injector.providers", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
}
}
#endif
/*--- Builtin init code ---*/
if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
/*--- Constants init code ---*/
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
/*--- Global init code ---*/
__pyx_v_19dependency_injector_9providers_CLASS_TYPES = Py_None; Py_INCREF(Py_None);
/*--- Variable export code ---*/
if (__Pyx_ExportVoidPtr(__pyx_n_s_CLASS_TYPES, (void *)&__pyx_v_19dependency_injector_9providers_CLASS_TYPES, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
/*--- Function export code ---*/
if (__Pyx_ExportFunction("parse_positional_injections", (void (*)(void))__pyx_f_19dependency_injector_9providers_parse_positional_injections, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("parse_named_injections", (void (*)(void))__pyx_f_19dependency_injector_9providers_parse_named_injections, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("is_provider", (void (*)(void))__pyx_f_19dependency_injector_9providers_is_provider, "int (PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("ensure_is_provider", (void (*)(void))__pyx_f_19dependency_injector_9providers_ensure_is_provider, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("is_delegated", (void (*)(void))__pyx_f_19dependency_injector_9providers_is_delegated, "int (PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("represent_provider", (void (*)(void))__pyx_f_19dependency_injector_9providers_represent_provider, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
if (__Pyx_ExportFunction("deepcopy", (void (*)(void))__pyx_f_19dependency_injector_9providers_deepcopy, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_19dependency_injector_9providers_deepcopy *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
/*--- Type init code ---*/
__pyx_vtabptr_19dependency_injector_9providers_Provider = &__pyx_vtable_19dependency_injector_9providers_Provider;
__pyx_vtable_19dependency_injector_9providers_Provider._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_8Provider__provide;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Provider) < 0) __PYX_ERR(1, 28, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Provider.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Provider, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 28, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Provider___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Provider___init__.doc = __pyx_doc_19dependency_injector_9providers_8Provider___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Provider___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Provider, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 28, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_2__call__.doc = __pyx_doc_19dependency_injector_9providers_8Provider_2__call__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Provider_2__call__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Provider, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 28, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_6__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_6__str__.doc = __pyx_doc_19dependency_injector_9providers_8Provider_6__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Provider_6__str__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Provider, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(1, 28, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_8__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Provider_8__repr__.doc = __pyx_doc_19dependency_injector_9providers_8Provider_8__repr__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Provider_8__repr__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Provider.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Provider) < 0) __PYX_ERR(1, 28, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Provider", (PyObject *)&__pyx_type_19dependency_injector_9providers_Provider) < 0) __PYX_ERR(1, 28, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Provider = &__pyx_type_19dependency_injector_9providers_Provider;
__pyx_vtabptr_19dependency_injector_9providers_Object = &__pyx_vtable_19dependency_injector_9providers_Object;
__pyx_vtable_19dependency_injector_9providers_Object.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_vtable_19dependency_injector_9providers_Object.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_6Object__provide;
__pyx_type_19dependency_injector_9providers_Object.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Object) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Object.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Object, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 208, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_6Object___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_6Object___init__.doc = __pyx_doc_19dependency_injector_9providers_6Object___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_6Object___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Object, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 208, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_6Object_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_6Object_4__str__.doc = __pyx_doc_19dependency_injector_9providers_6Object_4__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_6Object_4__str__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Object, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(1, 208, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_6Object_6__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_6Object_6__repr__.doc = __pyx_doc_19dependency_injector_9providers_6Object_6__repr__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_6Object_6__repr__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Object.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Object) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Object", (PyObject *)&__pyx_type_19dependency_injector_9providers_Object) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Object = &__pyx_type_19dependency_injector_9providers_Object;
__pyx_vtabptr_19dependency_injector_9providers_Delegate = &__pyx_vtable_19dependency_injector_9providers_Delegate;
__pyx_vtable_19dependency_injector_9providers_Delegate.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Object;
__pyx_type_19dependency_injector_9providers_Delegate.tp_base = __pyx_ptype_19dependency_injector_9providers_Object;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Delegate) < 0) __PYX_ERR(1, 268, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Delegate.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Delegate, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 268, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Delegate___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Delegate___init__.doc = __pyx_doc_19dependency_injector_9providers_8Delegate___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Delegate___init__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Delegate.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Delegate) < 0) __PYX_ERR(1, 268, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Delegate", (PyObject *)&__pyx_type_19dependency_injector_9providers_Delegate) < 0) __PYX_ERR(1, 268, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Delegate = &__pyx_type_19dependency_injector_9providers_Delegate;
__pyx_vtabptr_19dependency_injector_9providers_ExternalDependency = &__pyx_vtable_19dependency_injector_9providers_ExternalDependency;
__pyx_vtable_19dependency_injector_9providers_ExternalDependency.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_type_19dependency_injector_9providers_ExternalDependency.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_ExternalDependency) < 0) __PYX_ERR(1, 287, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_ExternalDependency.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ExternalDependency, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 287, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency___init__.doc = __pyx_doc_19dependency_injector_9providers_18ExternalDependency___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ExternalDependency, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 287, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_4__call__.doc = __pyx_doc_19dependency_injector_9providers_18ExternalDependency_4__call__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_4__call__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ExternalDependency, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 287, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_6__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_6__str__.doc = __pyx_doc_19dependency_injector_9providers_18ExternalDependency_6__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_6__str__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ExternalDependency, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(1, 287, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_8__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_8__repr__.doc = __pyx_doc_19dependency_injector_9providers_18ExternalDependency_8__repr__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_18ExternalDependency_8__repr__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_ExternalDependency.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_ExternalDependency) < 0) __PYX_ERR(1, 287, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "ExternalDependency", (PyObject *)&__pyx_type_19dependency_injector_9providers_ExternalDependency) < 0) __PYX_ERR(1, 287, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_ExternalDependency = &__pyx_type_19dependency_injector_9providers_ExternalDependency;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_OverridingContext) < 0) __PYX_ERR(1, 383, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_OverridingContext.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_OverridingContext, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 383, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_17OverridingContext___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_17OverridingContext___init__.doc = __pyx_doc_19dependency_injector_9providers_17OverridingContext___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_17OverridingContext___init__;
}
}
#endif
if (PyObject_SetAttrString(__pyx_m, "OverridingContext", (PyObject *)&__pyx_type_19dependency_injector_9providers_OverridingContext) < 0) __PYX_ERR(1, 383, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_OverridingContext = &__pyx_type_19dependency_injector_9providers_OverridingContext;
__pyx_vtabptr_19dependency_injector_9providers_Callable = &__pyx_vtable_19dependency_injector_9providers_Callable;
__pyx_vtable_19dependency_injector_9providers_Callable.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_vtable_19dependency_injector_9providers_Callable.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_8Callable__provide;
__pyx_type_19dependency_injector_9providers_Callable.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Callable) < 0) __PYX_ERR(1, 419, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Callable.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Callable, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 419, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Callable___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Callable___init__.doc = __pyx_doc_19dependency_injector_9providers_8Callable___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Callable___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Callable, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 419, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_8Callable_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_8Callable_4__str__.doc = __pyx_doc_19dependency_injector_9providers_8Callable_4__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_8Callable_4__str__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Callable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Callable) < 0) __PYX_ERR(1, 419, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Callable", (PyObject *)&__pyx_type_19dependency_injector_9providers_Callable) < 0) __PYX_ERR(1, 419, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Callable = &__pyx_type_19dependency_injector_9providers_Callable;
__pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable = &__pyx_vtable_19dependency_injector_9providers_DelegatedCallable;
__pyx_vtable_19dependency_injector_9providers_DelegatedCallable.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Callable;
__pyx_type_19dependency_injector_9providers_DelegatedCallable.tp_base = __pyx_ptype_19dependency_injector_9providers_Callable;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_DelegatedCallable) < 0) __PYX_ERR(1, 600, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_DelegatedCallable.tp_print = 0;
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_DelegatedCallable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_DelegatedCallable) < 0) __PYX_ERR(1, 600, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "DelegatedCallable", (PyObject *)&__pyx_type_19dependency_injector_9providers_DelegatedCallable) < 0) __PYX_ERR(1, 600, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedCallable = &__pyx_type_19dependency_injector_9providers_DelegatedCallable;
2017-04-06 18:17:06 +03:00
__pyx_vtabptr_19dependency_injector_9providers_AbstractCallable = &__pyx_vtable_19dependency_injector_9providers_AbstractCallable;
__pyx_vtable_19dependency_injector_9providers_AbstractCallable.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Callable;
__pyx_vtable_19dependency_injector_9providers_AbstractCallable.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_16AbstractCallable__provide;
__pyx_type_19dependency_injector_9providers_AbstractCallable.tp_base = __pyx_ptype_19dependency_injector_9providers_Callable;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_AbstractCallable) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_type_19dependency_injector_9providers_AbstractCallable.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractCallable, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 609, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_16AbstractCallable___call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_16AbstractCallable___call__.doc = __pyx_doc_19dependency_injector_9providers_16AbstractCallable___call__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_16AbstractCallable___call__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_AbstractCallable.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_AbstractCallable) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "AbstractCallable", (PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractCallable) < 0) __PYX_ERR(1, 609, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_ptype_19dependency_injector_9providers_AbstractCallable = &__pyx_type_19dependency_injector_9providers_AbstractCallable;
2017-07-09 23:29:33 +03:00
__pyx_vtabptr_19dependency_injector_9providers_CallableDelegate = &__pyx_vtable_19dependency_injector_9providers_CallableDelegate;
__pyx_vtable_19dependency_injector_9providers_CallableDelegate.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Delegate;
__pyx_type_19dependency_injector_9providers_CallableDelegate.tp_base = __pyx_ptype_19dependency_injector_9providers_Delegate;
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_CallableDelegate) < 0) __PYX_ERR(1, 650, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_CallableDelegate.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_CallableDelegate, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 650, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_16CallableDelegate___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_16CallableDelegate___init__.doc = __pyx_doc_19dependency_injector_9providers_16CallableDelegate___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_16CallableDelegate___init__;
}
}
#endif
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_CallableDelegate.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_CallableDelegate) < 0) __PYX_ERR(1, 650, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "CallableDelegate", (PyObject *)&__pyx_type_19dependency_injector_9providers_CallableDelegate) < 0) __PYX_ERR(1, 650, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_CallableDelegate = &__pyx_type_19dependency_injector_9providers_CallableDelegate;
__pyx_vtabptr_19dependency_injector_9providers_Configuration = &__pyx_vtable_19dependency_injector_9providers_Configuration;
__pyx_vtable_19dependency_injector_9providers_Configuration.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_vtable_19dependency_injector_9providers_Configuration.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_13Configuration__provide;
__pyx_vtable_19dependency_injector_9providers_Configuration.get_name = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_13Configuration_get_name;
__pyx_vtable_19dependency_injector_9providers_Configuration.update = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_13Configuration_update;
__pyx_vtable_19dependency_injector_9providers_Configuration._get_child_name = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Configuration *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_13Configuration__get_child_name;
__pyx_type_19dependency_injector_9providers_Configuration.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Configuration) < 0) __PYX_ERR(1, 672, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Configuration.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Configuration, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 672, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration___init__.doc = __pyx_doc_19dependency_injector_9providers_13Configuration___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_13Configuration___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Configuration, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 672, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_4__str__.doc = __pyx_doc_19dependency_injector_9providers_13Configuration_4__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_4__str__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Configuration, "__getattr__"); if (unlikely(!wrapper)) __PYX_ERR(1, 672, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_6__getattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_6__getattr__.doc = __pyx_doc_19dependency_injector_9providers_13Configuration_6__getattr__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_13Configuration_6__getattr__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Configuration.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Configuration) < 0) __PYX_ERR(1, 672, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Configuration", (PyObject *)&__pyx_type_19dependency_injector_9providers_Configuration) < 0) __PYX_ERR(1, 672, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Configuration = &__pyx_type_19dependency_injector_9providers_Configuration;
__pyx_vtabptr_19dependency_injector_9providers_Factory = &__pyx_vtable_19dependency_injector_9providers_Factory;
__pyx_vtable_19dependency_injector_9providers_Factory.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_vtable_19dependency_injector_9providers_Factory.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_7Factory__provide;
__pyx_type_19dependency_injector_9providers_Factory.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Factory) < 0) __PYX_ERR(1, 797, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Factory.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Factory, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 797, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_7Factory___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_7Factory___init__.doc = __pyx_doc_19dependency_injector_9providers_7Factory___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_7Factory___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Factory, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 797, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_7Factory_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_7Factory_4__str__.doc = __pyx_doc_19dependency_injector_9providers_7Factory_4__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_7Factory_4__str__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Factory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Factory) < 0) __PYX_ERR(1, 797, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Factory", (PyObject *)&__pyx_type_19dependency_injector_9providers_Factory) < 0) __PYX_ERR(1, 797, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Factory = &__pyx_type_19dependency_injector_9providers_Factory;
__pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory = &__pyx_vtable_19dependency_injector_9providers_DelegatedFactory;
__pyx_vtable_19dependency_injector_9providers_DelegatedFactory.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Factory;
__pyx_type_19dependency_injector_9providers_DelegatedFactory.tp_base = __pyx_ptype_19dependency_injector_9providers_Factory;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_DelegatedFactory) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_DelegatedFactory.tp_print = 0;
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_DelegatedFactory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_DelegatedFactory) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "DelegatedFactory", (PyObject *)&__pyx_type_19dependency_injector_9providers_DelegatedFactory) < 0) __PYX_ERR(1, 1030, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedFactory = &__pyx_type_19dependency_injector_9providers_DelegatedFactory;
2017-04-06 18:17:06 +03:00
__pyx_vtabptr_19dependency_injector_9providers_AbstractFactory = &__pyx_vtable_19dependency_injector_9providers_AbstractFactory;
__pyx_vtable_19dependency_injector_9providers_AbstractFactory.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Factory;
__pyx_vtable_19dependency_injector_9providers_AbstractFactory.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_15AbstractFactory__provide;
__pyx_type_19dependency_injector_9providers_AbstractFactory.tp_base = __pyx_ptype_19dependency_injector_9providers_Factory;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_AbstractFactory) < 0) __PYX_ERR(1, 1051, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_type_19dependency_injector_9providers_AbstractFactory.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractFactory, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1051, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_15AbstractFactory___call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_15AbstractFactory___call__.doc = __pyx_doc_19dependency_injector_9providers_15AbstractFactory___call__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_15AbstractFactory___call__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_AbstractFactory.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_AbstractFactory) < 0) __PYX_ERR(1, 1051, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "AbstractFactory", (PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractFactory) < 0) __PYX_ERR(1, 1051, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_ptype_19dependency_injector_9providers_AbstractFactory = &__pyx_type_19dependency_injector_9providers_AbstractFactory;
2017-07-09 23:13:10 +03:00
__pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate = &__pyx_vtable_19dependency_injector_9providers_FactoryDelegate;
__pyx_vtable_19dependency_injector_9providers_FactoryDelegate.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Delegate;
__pyx_type_19dependency_injector_9providers_FactoryDelegate.tp_base = __pyx_ptype_19dependency_injector_9providers_Delegate;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_FactoryDelegate) < 0) __PYX_ERR(1, 1092, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__pyx_type_19dependency_injector_9providers_FactoryDelegate.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_FactoryDelegate, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1092, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_15FactoryDelegate___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_15FactoryDelegate___init__.doc = __pyx_doc_19dependency_injector_9providers_15FactoryDelegate___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_15FactoryDelegate___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_FactoryDelegate.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_FactoryDelegate) < 0) __PYX_ERR(1, 1092, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "FactoryDelegate", (PyObject *)&__pyx_type_19dependency_injector_9providers_FactoryDelegate) < 0) __PYX_ERR(1, 1092, __pyx_L1_error)
2017-07-09 23:13:10 +03:00
__pyx_ptype_19dependency_injector_9providers_FactoryDelegate = &__pyx_type_19dependency_injector_9providers_FactoryDelegate;
__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton = &__pyx_vtable_19dependency_injector_9providers_BaseSingleton;
__pyx_vtable_19dependency_injector_9providers_BaseSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Provider;
__pyx_type_19dependency_injector_9providers_BaseSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_Provider;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_BaseSingleton) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_BaseSingleton.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_BaseSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1114, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_13BaseSingleton___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton___init__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_BaseSingleton, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1114, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton_2__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton_2__str__.doc = __pyx_doc_19dependency_injector_9providers_13BaseSingleton_2__str__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_13BaseSingleton_2__str__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_BaseSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_BaseSingleton) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "BaseSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_BaseSingleton) < 0) __PYX_ERR(1, 1114, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_BaseSingleton = &__pyx_type_19dependency_injector_9providers_BaseSingleton;
__pyx_vtabptr_19dependency_injector_9providers_Singleton = &__pyx_vtable_19dependency_injector_9providers_Singleton;
__pyx_vtable_19dependency_injector_9providers_Singleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
__pyx_vtable_19dependency_injector_9providers_Singleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_9Singleton__provide;
__pyx_type_19dependency_injector_9providers_Singleton.tp_base = __pyx_ptype_19dependency_injector_9providers_BaseSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Singleton) < 0) __PYX_ERR(1, 1288, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Singleton.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_Singleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1288, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_9Singleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_9Singleton___init__.doc = __pyx_doc_19dependency_injector_9providers_9Singleton___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_9Singleton___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_Singleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_Singleton) < 0) __PYX_ERR(1, 1288, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "Singleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_Singleton) < 0) __PYX_ERR(1, 1288, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Singleton = &__pyx_type_19dependency_injector_9providers_Singleton;
__pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton = &__pyx_vtable_19dependency_injector_9providers_DelegatedSingleton;
__pyx_vtable_19dependency_injector_9providers_DelegatedSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_Singleton;
__pyx_type_19dependency_injector_9providers_DelegatedSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_Singleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_DelegatedSingleton) < 0) __PYX_ERR(1, 1349, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_DelegatedSingleton.tp_print = 0;
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_DelegatedSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_DelegatedSingleton) < 0) __PYX_ERR(1, 1349, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "DelegatedSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_DelegatedSingleton) < 0) __PYX_ERR(1, 1349, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton = &__pyx_type_19dependency_injector_9providers_DelegatedSingleton;
__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton = &__pyx_vtable_19dependency_injector_9providers_ThreadSafeSingleton;
__pyx_vtable_19dependency_injector_9providers_ThreadSafeSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
__pyx_vtable_19dependency_injector_9providers_ThreadSafeSingleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_19ThreadSafeSingleton__provide;
__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_BaseSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton) < 0) __PYX_ERR(1, 1370, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1370, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_19ThreadSafeSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_19ThreadSafeSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_19ThreadSafeSingleton___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_19ThreadSafeSingleton___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton) < 0) __PYX_ERR(1, 1370, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "ThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton) < 0) __PYX_ERR(1, 1370, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton = &__pyx_type_19dependency_injector_9providers_ThreadSafeSingleton;
__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton = &__pyx_vtable_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
__pyx_vtable_19dependency_injector_9providers_DelegatedThreadSafeSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_ThreadSafeSingleton;
__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 1411, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton.tp_print = 0;
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 1411, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadSafeSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton) < 0) __PYX_ERR(1, 1411, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton = &__pyx_type_19dependency_injector_9providers_DelegatedThreadSafeSingleton;
__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton = &__pyx_vtable_19dependency_injector_9providers_ThreadLocalSingleton;
__pyx_vtable_19dependency_injector_9providers_ThreadLocalSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
__pyx_vtable_19dependency_injector_9providers_ThreadLocalSingleton.__pyx_base.__pyx_base._provide = (PyObject *(*)(struct __pyx_obj_19dependency_injector_9providers_Provider *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_19dependency_injector_9providers_20ThreadLocalSingleton__provide;
__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_BaseSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton) < 0) __PYX_ERR(1, 1432, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1432, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_20ThreadLocalSingleton___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_20ThreadLocalSingleton___init__.doc = __pyx_doc_19dependency_injector_9providers_20ThreadLocalSingleton___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_20ThreadLocalSingleton___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton) < 0) __PYX_ERR(1, 1432, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "ThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton) < 0) __PYX_ERR(1, 1432, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton = &__pyx_type_19dependency_injector_9providers_ThreadLocalSingleton;
__pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton = &__pyx_vtable_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
__pyx_vtable_19dependency_injector_9providers_DelegatedThreadLocalSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_ThreadLocalSingleton;
__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_ThreadLocalSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 1485, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton.tp_print = 0;
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 1485, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "DelegatedThreadLocalSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton) < 0) __PYX_ERR(1, 1485, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton = &__pyx_type_19dependency_injector_9providers_DelegatedThreadLocalSingleton;
2017-04-06 18:17:06 +03:00
__pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton = &__pyx_vtable_19dependency_injector_9providers_AbstractSingleton;
__pyx_vtable_19dependency_injector_9providers_AbstractSingleton.__pyx_base = *__pyx_vtabptr_19dependency_injector_9providers_BaseSingleton;
__pyx_type_19dependency_injector_9providers_AbstractSingleton.tp_base = __pyx_ptype_19dependency_injector_9providers_BaseSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_AbstractSingleton) < 0) __PYX_ERR(1, 1506, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_type_19dependency_injector_9providers_AbstractSingleton.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractSingleton, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1506, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_17AbstractSingleton___call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_17AbstractSingleton___call__.doc = __pyx_doc_19dependency_injector_9providers_17AbstractSingleton___call__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_17AbstractSingleton___call__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (__Pyx_SetVtable(__pyx_type_19dependency_injector_9providers_AbstractSingleton.tp_dict, __pyx_vtabptr_19dependency_injector_9providers_AbstractSingleton) < 0) __PYX_ERR(1, 1506, __pyx_L1_error)
if (PyObject_SetAttrString(__pyx_m, "AbstractSingleton", (PyObject *)&__pyx_type_19dependency_injector_9providers_AbstractSingleton) < 0) __PYX_ERR(1, 1506, __pyx_L1_error)
2017-04-06 18:17:06 +03:00
__pyx_ptype_19dependency_injector_9providers_AbstractSingleton = &__pyx_type_19dependency_injector_9providers_AbstractSingleton;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_Injection) < 0) __PYX_ERR(1, 1551, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_Injection.tp_print = 0;
2017-07-09 23:29:33 +03:00
if (PyObject_SetAttrString(__pyx_m, "Injection", (PyObject *)&__pyx_type_19dependency_injector_9providers_Injection) < 0) __PYX_ERR(1, 1551, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_Injection = &__pyx_type_19dependency_injector_9providers_Injection;
__pyx_type_19dependency_injector_9providers_PositionalInjection.tp_base = __pyx_ptype_19dependency_injector_9providers_Injection;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_PositionalInjection) < 0) __PYX_ERR(1, 1555, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_PositionalInjection.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_PositionalInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1555, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_19PositionalInjection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_19PositionalInjection___init__.doc = __pyx_doc_19dependency_injector_9providers_19PositionalInjection___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_19PositionalInjection___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (PyObject_SetAttrString(__pyx_m, "PositionalInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_PositionalInjection) < 0) __PYX_ERR(1, 1555, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_PositionalInjection = &__pyx_type_19dependency_injector_9providers_PositionalInjection;
__pyx_type_19dependency_injector_9providers_NamedInjection.tp_base = __pyx_ptype_19dependency_injector_9providers_Injection;
2017-07-09 23:29:33 +03:00
if (PyType_Ready(&__pyx_type_19dependency_injector_9providers_NamedInjection) < 0) __PYX_ERR(1, 1583, __pyx_L1_error)
__pyx_type_19dependency_injector_9providers_NamedInjection.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
2017-07-09 23:29:33 +03:00
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_19dependency_injector_9providers_NamedInjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 1583, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_19dependency_injector_9providers_14NamedInjection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_19dependency_injector_9providers_14NamedInjection___init__.doc = __pyx_doc_19dependency_injector_9providers_14NamedInjection___init__;
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_19dependency_injector_9providers_14NamedInjection___init__;
}
}
#endif
2017-07-09 23:29:33 +03:00
if (PyObject_SetAttrString(__pyx_m, "NamedInjection", (PyObject *)&__pyx_type_19dependency_injector_9providers_NamedInjection) < 0) __PYX_ERR(1, 1583, __pyx_L1_error)
__pyx_ptype_19dependency_injector_9providers_NamedInjection = &__pyx_type_19dependency_injector_9providers_NamedInjection;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
#endif
/* "dependency_injector/providers.pyx":7
*
*
* import copy # <<<<<<<<<<<<<<
* import sys
* import types
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(1, 7, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":8
*
* import copy
* import sys # <<<<<<<<<<<<<<
* import types
* import threading
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":9
* import copy
* import sys
* import types # <<<<<<<<<<<<<<
* import threading
*
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":10
* import sys
* import types
* import threading # <<<<<<<<<<<<<<
*
* from .errors import Error
*/
__pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(1, 10, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":12
* import threading
*
* from .errors import Error # <<<<<<<<<<<<<<
*
* cimport cython
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_Error);
__Pyx_GIVEREF(__pyx_n_s_Error);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Error);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_errors, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "dependency_injector/providers.pyx":17
*
*
* if sys.version_info[0] == 3: # pragma: no cover # <<<<<<<<<<<<<<
* CLASS_TYPES = (type,)
* else: # pragma: no cover
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 17, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
/* "dependency_injector/providers.pyx":18
*
* if sys.version_info[0] == 3: # pragma: no cover
* CLASS_TYPES = (type,) # <<<<<<<<<<<<<<
* else: # pragma: no cover
* CLASS_TYPES = (type, types.ClassType)
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)(&PyType_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyType_Type)));
__Pyx_XGOTREF(__pyx_v_19dependency_injector_9providers_CLASS_TYPES);
__Pyx_DECREF_SET(__pyx_v_19dependency_injector_9providers_CLASS_TYPES, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":17
*
*
* if sys.version_info[0] == 3: # pragma: no cover # <<<<<<<<<<<<<<
* CLASS_TYPES = (type,)
* else: # pragma: no cover
*/
goto __pyx_L2;
}
/* "dependency_injector/providers.pyx":20
* CLASS_TYPES = (type,)
* else: # pragma: no cover
* CLASS_TYPES = (type, types.ClassType) # <<<<<<<<<<<<<<
*
* copy._deepcopy_dispatch[types.MethodType] = \
*/
/*else*/ {
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ClassType); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)(&PyType_Type)));
__Pyx_GIVEREF(((PyObject *)(&PyType_Type)));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyType_Type)));
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_XGOTREF(__pyx_v_19dependency_injector_9providers_CLASS_TYPES);
__Pyx_DECREF_SET(__pyx_v_19dependency_injector_9providers_CLASS_TYPES, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
/* "dependency_injector/providers.pyx":23
*
* copy._deepcopy_dispatch[types.MethodType] = \
* lambda obj, memo: type(obj)(obj.im_func, # <<<<<<<<<<<<<<
* copy.deepcopy(obj.im_self, memo),
* obj.im_class)
*/
__pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_19dependency_injector_9providers_14lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_dependency_injector_providers, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
/* "dependency_injector/providers.pyx":22
* CLASS_TYPES = (type, types.ClassType)
*
* copy._deepcopy_dispatch[types.MethodType] = \ # <<<<<<<<<<<<<<
* lambda obj, memo: type(obj)(obj.im_func,
* copy.deepcopy(obj.im_self, memo),
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deepcopy_dispatch); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(1, 22, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L2:;
/* "dependency_injector/providers.pyx":75
* """
*
* __IS_PROVIDER__ = True # <<<<<<<<<<<<<<
*
* overriding_lock = threading.RLock()
*/
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider->tp_dict, __pyx_n_s_IS_PROVIDER, Py_True) < 0) __PYX_ERR(1, 75, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_Provider);
/* "dependency_injector/providers.pyx":77
* __IS_PROVIDER__ = True
*
* overriding_lock = threading.RLock() # <<<<<<<<<<<<<<
2017-04-19 00:00:29 +03:00
* """Overriding reentrant lock.
*
*/
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_RLock); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (__pyx_t_5) {
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_Provider->tp_dict, __pyx_n_s_overriding_lock, __pyx_t_1) < 0) __PYX_ERR(1, 77, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_Provider);
/* "dependency_injector/providers.pyx":606
* """
*
* __IS_DELEGATED__ = True # <<<<<<<<<<<<<<
*
*
*/
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_DelegatedCallable->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 606, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_DelegatedCallable);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":848
* """
*
* provided_type = None # <<<<<<<<<<<<<<
*
* def __init__(self, provides, *args, **kwargs):
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_Factory->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(1, 848, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_Factory);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1048
* """
*
* __IS_DELEGATED__ = True # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_DelegatedFactory->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 1048, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_DelegatedFactory);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1117
* """Base class of singleton providers."""
*
* provided_type = None # <<<<<<<<<<<<<<
*
* def __init__(self, provides, *args, **kwargs):
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_BaseSingleton->tp_dict, __pyx_n_s_provided_type, Py_None) < 0) __PYX_ERR(1, 1117, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_BaseSingleton);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1367
* """
*
* __IS_DELEGATED__ = True # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 1367, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_DelegatedSingleton);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1373
* """Thread-safe singleton provider."""
*
* storage_lock = threading.RLock() # <<<<<<<<<<<<<<
* """Storage reentrant lock.
*
*/
2017-07-09 23:29:33 +03:00
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
2017-07-09 23:29:33 +03:00
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
if (__pyx_t_4) {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
2017-07-09 23:29:33 +03:00
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1373, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton->tp_dict, __pyx_n_s_storage_lock, __pyx_t_1) < 0) __PYX_ERR(1, 1373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_ThreadSafeSingleton);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1429
* """
*
* __IS_DELEGATED__ = True # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 1429, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadSafeSingleton);
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pyx":1503
* """
*
* __IS_DELEGATED__ = True # <<<<<<<<<<<<<<
*
*
*/
2017-07-09 23:29:33 +03:00
if (PyDict_SetItem((PyObject *)__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton->tp_dict, __pyx_n_s_IS_DELEGATED, Py_True) < 0) __PYX_ERR(1, 1503, __pyx_L1_error)
PyType_Modified(__pyx_ptype_19dependency_injector_9providers_DelegatedThreadLocalSingleton);
/* "dependency_injector/providers.pyx":1
* """Dependency injector providers. # <<<<<<<<<<<<<<
*
* Powered by Cython.
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2017-07-09 23:29:33 +03:00
/* "dependency_injector/providers.pxd":260
*
*
* cdef inline object __factory_call(Factory self, tuple args, dict kwargs): # <<<<<<<<<<<<<<
* cdef object instance
*
*/
/*--- Wrapped vars code ---*/
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
__Pyx_AddTraceback("init dependency_injector.providers", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_ImportError, "init dependency_injector.providers");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
#if PY_MAJOR_VERSION < 3
return;
#else
return __pyx_m;
#endif
}
/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
void *r = NULL;
m = PyImport_ImportModule((char *)modname);
if (!m) goto end;
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
if (!p) goto end;
r = PyLong_AsVoidPtr(p);
end:
Py_XDECREF(p);
Py_XDECREF(m);
return (__Pyx_RefNannyAPIStruct *)r;
}
#endif
/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
"name '%U' is not defined", name);
#else
"name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
}
return result;
}
/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
Py_ssize_t num_min,
Py_ssize_t num_max,
Py_ssize_t num_found)
{
Py_ssize_t num_expected;
const char *more_or_less;
if (num_found < num_min) {
num_expected = num_min;
more_or_less = "at least";
} else {
num_expected = num_max;
more_or_less = "at most";
}
if (exact) {
more_or_less = "exactly";
}
PyErr_Format(PyExc_TypeError,
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
func_name, more_or_less, num_expected,
(num_expected == 1) ? "" : "s", num_found);
}
/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
{
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION >= 3
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
#else
"%s() got multiple values for keyword argument '%s'", func_name,
PyString_AsString(kw_name));
#endif
}
/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
PyObject *kwds2,
PyObject *values[],
Py_ssize_t num_pos_args,
const char* function_name)
{
PyObject *key = 0, *value = 0;
Py_ssize_t pos = 0;
PyObject*** name;
PyObject*** first_kw_arg = argnames + num_pos_args;
while (PyDict_Next(kwds, &pos, &key, &value)) {
name = first_kw_arg;
while (*name && (**name != key)) name++;
if (*name) {
values[name-argnames] = value;
continue;
}
name = first_kw_arg;
#if PY_MAJOR_VERSION < 3
if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
while (*name) {
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
&& _PyString_Eq(**name, key)) {
values[name-argnames] = value;
break;
}
name++;
}
if (*name) continue;
else {
PyObject*** argname = argnames;
while (argname != first_kw_arg) {
if ((**argname == key) || (
(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
&& _PyString_Eq(**argname, key))) {
goto arg_passed_twice;
}
argname++;
}
}
} else
#endif
if (likely(PyUnicode_Check(key))) {
while (*name) {
int cmp = (**name == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
#endif
PyUnicode_Compare(**name, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
if (cmp == 0) {
values[name-argnames] = value;
break;
}
name++;
}
if (*name) continue;
else {
PyObject*** argname = argnames;
while (argname != first_kw_arg) {
int cmp = (**argname == key) ? 0 :
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
#endif
PyUnicode_Compare(**argname, key);
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
if (cmp == 0) goto arg_passed_twice;
argname++;
}
}
} else
goto invalid_keyword_type;
if (kwds2) {
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
} else {
goto invalid_keyword;
}
}
return 0;
arg_passed_twice:
__Pyx_RaiseDoubleKeywordsError(function_name, key);
goto bad;
invalid_keyword_type:
PyErr_Format(PyExc_TypeError,
"%.200s() keywords must be strings", function_name);
goto bad;
invalid_keyword:
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
"%.200s() got an unexpected keyword argument '%.200s'",
function_name, PyString_AsString(key));
#else
"%s() got an unexpected keyword argument '%U'",
function_name, key);
#endif
bad:
return -1;
}
/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
} else {
#else
result = PyObject_GetItem(__pyx_d, name);
if (!result) {
PyErr_Clear();
#endif
result = __Pyx_GetBuiltinName(name);
}
return result;
}
/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
PyObject *globals) {
PyFrameObject *f;
PyThreadState *tstate = PyThreadState_GET();
PyObject **fastlocals;
Py_ssize_t i;
PyObject *result;
assert(globals != NULL);
/* XXX Perhaps we should create a specialized
PyFrame_New() that doesn't take locals, but does
take builtins without sanity checking them.
*/
assert(tstate != NULL);
f = PyFrame_New(tstate, co, globals, NULL);
if (f == NULL) {
return NULL;
}
fastlocals = f->f_localsplus;
for (i = 0; i < na; i++) {
Py_INCREF(*args);
fastlocals[i] = *args++;
}
result = PyEval_EvalFrameEx(f,0);
++tstate->recursion_depth;
Py_DECREF(f);
--tstate->recursion_depth;
return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
PyObject *globals = PyFunction_GET_GLOBALS(func);
PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
PyObject *closure;
#if PY_MAJOR_VERSION >= 3
PyObject *kwdefs;
#endif
PyObject *kwtuple, **k;
PyObject **d;
Py_ssize_t nd;
Py_ssize_t nk;
PyObject *result;
assert(kwargs == NULL || PyDict_Check(kwargs));
nk = kwargs ? PyDict_Size(kwargs) : 0;
if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
return NULL;
}
if (
#if PY_MAJOR_VERSION >= 3
co->co_kwonlyargcount == 0 &&
#endif
likely(kwargs == NULL || nk == 0) &&
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
if (argdefs == NULL && co->co_argcount == nargs) {
result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
goto done;
}
else if (nargs == 0 && argdefs != NULL
&& co->co_argcount == Py_SIZE(argdefs)) {
/* function called with no arguments, but all parameters have
a default value: use default values as arguments .*/
args = &PyTuple_GET_ITEM(argdefs, 0);
result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
goto done;
}
}
if (kwargs != NULL) {
Py_ssize_t pos, i;
kwtuple = PyTuple_New(2 * nk);
if (kwtuple == NULL) {
result = NULL;
goto done;
}
k = &PyTuple_GET_ITEM(kwtuple, 0);
pos = i = 0;
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
Py_INCREF(k[i]);
Py_INCREF(k[i+1]);
i += 2;
}
nk = i / 2;
}
else {
kwtuple = NULL;
k = NULL;
}
closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
if (argdefs != NULL) {
d = &PyTuple_GET_ITEM(argdefs, 0);
nd = Py_SIZE(argdefs);
}
else {
d = NULL;
nd = 0;
}
#if PY_MAJOR_VERSION >= 3
result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
args, nargs,
k, (int)nk,
d, (int)nd, kwdefs, closure);
#else
result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
args, nargs,
k, (int)nk,
d, (int)nd, closure);
#endif
Py_XDECREF(kwtuple);
done:
Py_LeaveRecursiveCall();
return result;
}
#endif // CPython < 3.6
#endif // CYTHON_FAST_PYCALL
/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
PyObject *self = PyCFunction_GET_SELF(func);
assert(PyCFunction_Check(func));
assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
assert(nargs >= 0);
assert(nargs == 0 || args != NULL);
/* _PyCFunction_FastCallDict() must not be called with an exception set,
because it may clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
}
#endif // CYTHON_FAST_PYCCALL
/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
if (unlikely(!call))
return PyObject_Call(func, arg, kw);
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
return NULL;
result = (*call)(func, arg, kw);
Py_LeaveRecursiveCall();
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
PyErr_SetString(
PyExc_SystemError,
"NULL result without error in PyObject_Call");
}
return result;
}
#endif
/* KeywordStringCheck */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
PyObject *kwdict,
const char* function_name,
int kw_allowed)
{
PyObject* key = 0;
Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
goto invalid_keyword;
return 1;
#else
while (PyDict_Next(kwdict, &pos, &key, 0)) {
#if PY_MAJOR_VERSION < 3
if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
#endif
if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
}
if ((!kw_allowed) && unlikely(key))
goto invalid_keyword;
return 1;
invalid_keyword_type:
PyErr_Format(PyExc_TypeError,
"%.200s() keywords must be strings", function_name);
return 0;
#endif
invalid_keyword:
PyErr_Format(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
"%.200s() got an unexpected keyword argument '%.200s'",
function_name, PyString_AsString(key));
#else
"%s() got an unexpected keyword argument '%U'",
function_name, key);
#endif
return 0;
}
/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
cfunc = PyCFunction_GET_FUNCTION(func);
self = PyCFunction_GET_SELF(func);
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
return NULL;
result = cfunc(self, arg);
Py_LeaveRecursiveCall();
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
PyErr_SetString(
PyExc_SystemError,
"NULL result without error in PyObject_Call");
}
return result;
}
#endif
/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
if (unlikely(!args)) return NULL;
Py_INCREF(arg);
PyTuple_SET_ITEM(args, 0, arg);
result = __Pyx_PyObject_Call(func, args, NULL);
Py_DECREF(args);
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(func)) {
return __Pyx_PyFunction_FastCall(func, &arg, 1);
}
#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
if (likely(PyCFunction_Check(func))) {
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
} else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_Pack(1, arg);
if (unlikely(!args)) return NULL;
result = __Pyx_PyObject_Call(func, args, NULL);
Py_DECREF(args);
return result;
}
#endif
/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(func)) {
return __Pyx_PyFunction_FastCall(func, NULL, 0);
}
#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
if (likely(PyCFunction_Check(func))) {
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
return __Pyx_PyObject_CallMethO(func, NULL);
}
}
return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif
/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
tstate->curexc_type = type;
tstate->curexc_value = value;
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
}
#endif
/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
__Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
else
Py_INCREF(value);
if (!tb || tb == Py_None)
tb = NULL;
else {
Py_INCREF(tb);
if (!PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
}
if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
if (!value) {
Py_INCREF(Py_None);
value = Py_None;
}
#endif
PyErr_NormalizeException(&type, &value, &tb);
} else {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
value = type;
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
}
__Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
PyObject* owned_instance = NULL;
if (tb == Py_None) {
tb = 0;
} else if (tb && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto bad;
}
if (value == Py_None)
value = 0;
if (PyExceptionInstance_Check(type)) {
if (value) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto bad;
}
value = type;
type = (PyObject*) Py_TYPE(value);
} else if (PyExceptionClass_Check(type)) {
PyObject *instance_class = NULL;
if (value && PyExceptionInstance_Check(value)) {
instance_class = (PyObject*) Py_TYPE(value);
if (instance_class != type) {
int is_subclass = PyObject_IsSubclass(instance_class, type);
if (!is_subclass) {
instance_class = NULL;
} else if (unlikely(is_subclass == -1)) {
goto bad;
} else {
type = instance_class;
}
}
}
if (!instance_class) {
PyObject *args;
if (!value)
args = PyTuple_New(0);
else if (PyTuple_Check(value)) {
Py_INCREF(value);
args = value;
} else
args = PyTuple_Pack(1, value);
if (!args)
goto bad;
owned_instance = PyObject_Call(type, args, NULL);
Py_DECREF(args);
if (!owned_instance)
goto bad;
value = owned_instance;
if (!PyExceptionInstance_Check(value)) {
PyErr_Format(PyExc_TypeError,
"calling %R should have returned an instance of "
"BaseException, not %R",
type, Py_TYPE(value));
goto bad;
}
}
} else {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto bad;
}
#if PY_VERSION_HEX >= 0x03030000
if (cause) {
#else
if (cause && cause != Py_None) {
#endif
PyObject *fixed_cause;
if (cause == Py_None) {
fixed_cause = NULL;
} else if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;
} else if (PyExceptionInstance_Check(cause)) {
fixed_cause = cause;
Py_INCREF(fixed_cause);
} else {
PyErr_SetString(PyExc_TypeError,
"exception causes must derive from "
"BaseException");
goto bad;
}
PyException_SetCause(value, fixed_cause);
}
PyErr_SetObject(type, value);
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
Py_INCREF(tb);
PyErr_Restore(tmp_type, tmp_value, tb);
Py_XDECREF(tmp_tb);
#else
PyThreadState *tstate = PyThreadState_GET();
PyObject* tmp_tb = tstate->curexc_traceback;
if (tb != tmp_tb) {
Py_INCREF(tb);
tstate->curexc_traceback = tb;
Py_XDECREF(tmp_tb);
}
#endif
}
bad:
Py_XDECREF(owned_instance);
return;
}
#endif
/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
}
if (likely(PyObject_TypeCheck(obj, type)))
return 1;
PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
Py_TYPE(obj)->tp_name, type->tp_name);
return 0;
}
/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = type;
tstate->exc_value = value;
tstate->exc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}
#endif
/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
PyObject *tmp_type, *tmp_value, *tmp_tb;
local_type = tstate->curexc_type;
local_value = tstate->curexc_value;
local_tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
#else
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
#endif
goto bad;
#if PY_MAJOR_VERSION >= 3
if (local_tb) {
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
goto bad;
}
#endif
Py_XINCREF(local_tb);
Py_XINCREF(local_type);
Py_XINCREF(local_value);
*type = local_type;
*value = local_value;
*tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = local_type;
tstate->exc_value = local_value;
tstate->exc_traceback = local_tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
#else
PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
return 0;
bad:
*type = 0;
*value = 0;
*tb = 0;
Py_XDECREF(local_type);
Py_XDECREF(local_value);
Py_XDECREF(local_tb);
return -1;
}
/* SliceTupleAndList */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
Py_ssize_t start = *_start, stop = *_stop, length = *_length;
if (start < 0) {
start += length;
if (start < 0)
start = 0;
}
if (stop < 0)
stop += length;
else if (stop > length)
stop = length;
*_length = stop - start;
*_start = start;
*_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
PyObject *v;
Py_ssize_t i;
for (i = 0; i < length; i++) {
v = dest[i] = src[i];
Py_INCREF(v);
}
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
PyObject* dest;
Py_ssize_t length = PyList_GET_SIZE(src);
__Pyx_crop_slice(&start, &stop, &length);
if (unlikely(length <= 0))
return PyList_New(0);
dest = PyList_New(length);
if (unlikely(!dest))
return NULL;
__Pyx_copy_object_array(
((PyListObject*)src)->ob_item + start,
((PyListObject*)dest)->ob_item,
length);
return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
PyObject* dest;
Py_ssize_t length = PyTuple_GET_SIZE(src);
__Pyx_crop_slice(&start, &stop, &length);
if (unlikely(length <= 0))
return PyTuple_New(0);
dest = PyTuple_New(length);
if (unlikely(!dest))
return NULL;
__Pyx_copy_object_array(
((PyTupleObject*)src)->ob_item + start,
((PyTupleObject*)dest)->ob_item,
length);
return dest;
}
#endif
/* GetItemInt */
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
Py_DECREF(j);
return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
CYTHON_NCP_UNUSED int wraparound,
CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
PyObject *r = PyList_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
}
else if (PyTuple_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
} else {
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_item)) {
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
Py_ssize_t l = m->sq_length(o);
if (likely(l >= 0)) {
i += l;
} else {
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
PyErr_Clear();
}
}
return m->sq_item(o, i);
}
}
#else
if (is_list || PySequence_Check(o)) {
return PySequence_GetItem(o, i);
}
#endif
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
PyObject *exc_type = tstate->curexc_type;
if (exc_type == err) return 1;
if (unlikely(!exc_type)) return 0;
return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif
/* ArgTypeTest */
static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact)
{
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
}
if (none_allowed && obj == Py_None) return 1;
else if (exact) {
if (likely(Py_TYPE(obj) == type)) return 1;
#if PY_MAJOR_VERSION == 2
else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
#endif
}
else {
if (likely(PyObject_TypeCheck(obj, type))) return 1;
}
__Pyx_RaiseArgumentTypeInvalid(name, obj, type);
return 0;
}
/* StringJoin */
#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif
/* bytes_tailmatch */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
Py_ssize_t start, Py_ssize_t end, int direction) {
const char* self_ptr = PyBytes_AS_STRING(self);
Py_ssize_t self_len = PyBytes_GET_SIZE(self);
const char* sub_ptr;
Py_ssize_t sub_len;
int retval;
Py_buffer view;
view.obj = NULL;
if ( PyBytes_Check(arg) ) {
sub_ptr = PyBytes_AS_STRING(arg);
sub_len = PyBytes_GET_SIZE(arg);
}
#if PY_MAJOR_VERSION < 3
else if ( PyUnicode_Check(arg) ) {
return (int) PyUnicode_Tailmatch(self, arg, start, end, direction);
}
#endif
else {
if (unlikely(PyObject_GetBuffer(self, &view, PyBUF_SIMPLE) == -1))
return -1;
sub_ptr = (const char*) view.buf;
sub_len = view.len;
}
if (end > self_len)
end = self_len;
else if (end < 0)
end += self_len;
if (end < 0)
end = 0;
if (start < 0)
start += self_len;
if (start < 0)
start = 0;
if (direction > 0) {
if (end-sub_len > start)
start = end - sub_len;
}
if (start + sub_len <= end)
retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len);
else
retval = 0;
if (view.obj)
PyBuffer_Release(&view);
return retval;
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction) {
if (unlikely(PyTuple_Check(substr))) {
Py_ssize_t i, count = PyTuple_GET_SIZE(substr);
for (i = 0; i < count; i++) {
int result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substr, i),
start, end, direction);
#else
PyObject* sub = PySequence_ITEM(substr, i);
if (unlikely(!sub)) return -1;
result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction);
Py_DECREF(sub);
#endif
if (result) {
return result;
}
}
return 0;
}
return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction);
}
/* unicode_tailmatch */
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction) {
if (unlikely(PyTuple_Check(substr))) {
Py_ssize_t i, count = PyTuple_GET_SIZE(substr);
for (i = 0; i < count; i++) {
Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substr, i),
start, end, direction);
#else
PyObject* sub = PySequence_ITEM(substr, i);
if (unlikely(!sub)) return -1;
result = PyUnicode_Tailmatch(s, sub, start, end, direction);
Py_DECREF(sub);
#endif
if (result) {
return (int) result;
}
}
return 0;
}
return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}
/* str_tailmatch */
static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start,
Py_ssize_t end, int direction)
{
if (PY_MAJOR_VERSION < 3)
return __Pyx_PyBytes_Tailmatch(self, arg, start, end, direction);
else
return __Pyx_PyUnicode_Tailmatch(self, arg, start, end, direction);
}
/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (unlikely(PyErr_Occurred()))
return NULL;
value = default_value;
}
Py_INCREF(value);
#else
if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
value = PyDict_GetItem(d, key);
if (unlikely(!value)) {
value = default_value;
}
Py_INCREF(value);
} else {
if (default_value == Py_None)
default_value = NULL;
value = PyObject_CallMethodObjArgs(
d, __pyx_n_s_get, key, default_value, NULL);
}
#endif
return value;
}
/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = *type;
tstate->exc_value = *value;
tstate->exc_traceback = *tb;
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
#endif
/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}
/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
PyObject *method;
method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
if (unlikely(!method))
return -1;
target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
#endif
{
PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
target->func = descr->d_method->ml_meth;
target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
}
#endif
return 0;
}
/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
PyObject *args, *result = NULL;
if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
args = PyTuple_New(1);
if (unlikely(!args)) goto bad;
Py_INCREF(self);
PyTuple_SET_ITEM(args, 0, self);
#else
args = PyTuple_Pack(1, self);
if (unlikely(!args)) goto bad;
#endif
result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
Py_DECREF(args);
bad:
return result;
}
/* py_dict_items */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
if (PY_MAJOR_VERSION >= 3)
return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
else
return PyDict_Items(d);
}
/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
PyObject *exc_value, *exc_tb;
exc_value = tstate->curexc_value;
exc_tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
Py_DECREF(exc_type);
Py_XDECREF(exc_value);
Py_XDECREF(exc_tb);
return 0;
} else {
return -1;
}
}
return 0;
#else
if (unlikely(PyErr_Occurred())) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
PyErr_Clear();
return 0;
} else {
return -1;
}
}
return 0;
#endif
}
/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
return -1;
} else {
return __Pyx_IterFinish();
}
return 0;
}
/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
#else
if (likely(PyString_Check(n)))
#endif
return __Pyx_PyObject_GetAttrStr(o, n);
#endif
return PyObject_GetAttr(o, n);
}
/* GetAttr3 */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
PyObject *r = __Pyx_GetAttr(o, n);
if (unlikely(!r)) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
PyErr_Clear();
r = d;
Py_INCREF(d);
}
return r;
bad:
return NULL;
}
/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
__Pyx_PyThreadState_declare
#ifdef WITH_THREAD
PyGILState_STATE state;
if (nogil)
state = PyGILState_Ensure();
#ifdef _MSC_VER
else state = (PyGILState_STATE)-1;
#endif
#endif
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
Py_XINCREF(old_val);
Py_XINCREF(old_tb);
__Pyx_ErrRestore(old_exc, old_val, old_tb);
PyErr_PrintEx(1);
}
#if PY_MAJOR_VERSION < 3
ctx = PyString_FromString(name);
#else
ctx = PyUnicode_FromString(name);
#endif
__Pyx_ErrRestore(old_exc, old_val, old_tb);
if (!ctx) {
PyErr_WriteUnraisable(Py_None);
} else {
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
#ifdef WITH_THREAD
if (nogil)
PyGILState_Release(state);
#endif
}
/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
if (!ob)
goto bad;
if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
goto bad;
Py_DECREF(ob);
return 0;
bad:
Py_XDECREF(ob);
return -1;
}
/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
#if PY_VERSION_HEX < 0x03030000
PyObject *py_import;
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
if (!py_import)
goto bad;
#endif
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
{
#if PY_MAJOR_VERSION >= 3
if (level == -1) {
if (strchr(__Pyx_MODULE_NAME, '.')) {
#if PY_VERSION_HEX < 0x03030000
PyObject *py_level = PyInt_FromLong(1);
if (!py_level)
goto bad;
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, py_level, NULL);
Py_DECREF(py_level);
#else
module = PyImport_ImportModuleLevelObject(
name, global_dict, empty_dict, list, 1);
#endif
if (!module) {
if (!PyErr_ExceptionMatches(PyExc_ImportError))
goto bad;
PyErr_Clear();
}
}
level = 0;
}
#endif
if (!module) {
#if PY_VERSION_HEX < 0x03030000
PyObject *py_level = PyInt_FromLong(level);
if (!py_level)
goto bad;
module = PyObject_CallFunctionObjArgs(py_import,
name, global_dict, empty_dict, list, py_level, NULL);
Py_DECREF(py_level);
#else
module = PyImport_ImportModuleLevelObject(
name, global_dict, empty_dict, list, level);
#endif
}
}
bad:
#if PY_VERSION_HEX < 0x03030000
Py_XDECREF(py_import);
#endif
Py_XDECREF(empty_list);
Py_XDECREF(empty_dict);
return module;
}
/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Format(PyExc_ImportError,
#if PY_MAJOR_VERSION < 3
"cannot import name %.230s", PyString_AS_STRING(name));
#else
"cannot import name %S", name);
#endif
}
return value;
}
/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
if (op1 == op2) {
Py_RETURN_TRUE;
}
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(op1))) {
const long b = intval;
long a = PyInt_AS_LONG(op1);
if (a == b) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
if (likely(PyLong_CheckExact(op1))) {
const long b = intval;
long a;
const digit* digits = ((PyLongObject*)op1)->ob_digit;
const Py_ssize_t size = Py_SIZE(op1);
if (likely(__Pyx_sst_abs(size) <= 1)) {
a = likely(size) ? digits[0] : 0;
if (size == -1) a = -a;
} else {
switch (size) {
case -2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
case 2:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
case -3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
case 3:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
case -4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
case 4:
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
break;
}
#if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
#else
default: Py_RETURN_FALSE;
#endif
}
}
if (a == b) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
}
#endif
if (PyFloat_CheckExact(op1)) {
const long b = intval;
double a = PyFloat_AS_DOUBLE(op1);
if ((double)a == (double)b) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
}
return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif
/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
if (!fake_module) return NULL;
Py_INCREF(fake_module);
cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
if (cached_type) {
if (!PyType_Check((PyObject*)cached_type)) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s is not a type object",
type->tp_name);
goto bad;
}
if (cached_type->tp_basicsize != type->tp_basicsize) {
PyErr_Format(PyExc_TypeError,
"Shared Cython type %.200s has the wrong size, try recompiling",
type->tp_name);
goto bad;
}
} else {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
PyErr_Clear();
if (PyType_Ready(type) < 0) goto bad;
if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
goto bad;
Py_INCREF(type);
cached_type = type;
}
done:
Py_DECREF(fake_module);
return cached_type;
bad:
Py_XDECREF(cached_type);
cached_type = NULL;
goto done;
}
/* CythonFunction */
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
if (unlikely(op->func_doc == NULL))
return NULL;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
Py_INCREF(op->func_doc);
return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
PyObject *tmp = op->func_doc;
if (value == NULL) {
value = Py_None;
}
Py_INCREF(value);
op->func_doc = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
if (unlikely(op->func_name == NULL))
return NULL;
}
Py_INCREF(op->func_name);
return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
PyErr_SetString(PyExc_TypeError,
"__name__ must be set to a string object");
return -1;
}
tmp = op->func_name;
Py_INCREF(value);
op->func_name = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
Py_INCREF(op->func_qualname);
return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
PyErr_SetString(PyExc_TypeError,
"__qualname__ must be set to a string object");
return -1;
}
tmp = op->func_qualname;
Py_INCREF(value);
op->func_qualname = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
PyObject *self;
self = m->func_closure;
if (self == NULL)
self = Py_None;
Py_INCREF(self);
return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
if (unlikely(op->func_dict == NULL)) {
op->func_dict = PyDict_New();
if (unlikely(op->func_dict == NULL))
return NULL;
}
Py_INCREF(op->func_dict);
return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
PyObject *tmp;
if (unlikely(value == NULL)) {
PyErr_SetString(PyExc_TypeError,
"function's dictionary may not be deleted");
return -1;
}
if (unlikely(!PyDict_Check(value))) {
PyErr_SetString(PyExc_TypeError,
"setting function's dictionary to a non-dict");
return -1;
}
tmp = op->func_dict;
Py_INCREF(value);
op->func_dict = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
Py_INCREF(op->func_globals);
return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
PyObject* result = (op->func_code) ? op->func_code : Py_None;
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
#else
op->defaults_tuple = PySequence_ITEM(res, 0);
if (unlikely(!op->defaults_tuple)) result = -1;
else {
op->defaults_kwdict = PySequence_ITEM(res, 1);
if (unlikely(!op->defaults_kwdict)) result = -1;
}
#endif
Py_DECREF(res);
return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
PyObject* tmp;
if (!value) {
value = Py_None;
} else if (value != Py_None && !PyTuple_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__defaults__ must be set to a tuple object");
return -1;
}
Py_INCREF(value);
tmp = op->defaults_tuple;
op->defaults_tuple = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
PyObject* result = op->defaults_tuple;
if (unlikely(!result)) {
if (op->defaults_getter) {
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
result = op->defaults_tuple;
} else {
result = Py_None;
}
}
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
PyObject* tmp;
if (!value) {
value = Py_None;
} else if (value != Py_None && !PyDict_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__kwdefaults__ must be set to a dict object");
return -1;
}
Py_INCREF(value);
tmp = op->defaults_kwdict;
op->defaults_kwdict = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
PyObject* result = op->defaults_kwdict;
if (unlikely(!result)) {
if (op->defaults_getter) {
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
result = op->defaults_kwdict;
} else {
result = Py_None;
}
}
Py_INCREF(result);
return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
PyObject* tmp;
if (!value || value == Py_None) {
value = NULL;
} else if (!PyDict_Check(value)) {
PyErr_SetString(PyExc_TypeError,
"__annotations__ must be set to a dict object");
return -1;
}
Py_XINCREF(value);
tmp = op->func_annotations;
op->func_annotations = value;
Py_XDECREF(tmp);
return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
PyObject* result = op->func_annotations;
if (unlikely(!result)) {
result = PyDict_New();
if (unlikely(!result)) return NULL;
op->func_annotations = result;
}
Py_INCREF(result);
return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
{(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
{(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
{(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
{(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
{(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
{(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
{(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
{(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
{(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
{(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
{(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
{(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
{(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
{(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
{(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
{(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
{(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
{0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
{(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
{0, 0, 0, 0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
{"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
{0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
__pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
if (op == NULL)
return NULL;
op->flags = flags;
__Pyx_CyFunction_weakreflist(op) = NULL;
op->func.m_ml = ml;
op->func.m_self = (PyObject *) op;
Py_XINCREF(closure);
op->func_closure = closure;
Py_XINCREF(module);
op->func.m_module = module;
op->func_dict = NULL;
op->func_name = NULL;
Py_INCREF(qualname);
op->func_qualname = qualname;
op->func_doc = NULL;
op->func_classobj = NULL;
op->func_globals = globals;
Py_INCREF(op->func_globals);
Py_XINCREF(code);
op->func_code = code;
op->defaults_pyobjects = 0;
op->defaults = NULL;
op->defaults_tuple = NULL;
op->defaults_kwdict = NULL;
op->defaults_getter = NULL;
op->func_annotations = NULL;
PyObject_GC_Track(op);
return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
Py_CLEAR(m->func_closure);
Py_CLEAR(m->func.m_module);
Py_CLEAR(m->func_dict);
Py_CLEAR(m->func_name);
Py_CLEAR(m->func_qualname);
Py_CLEAR(m->func_doc);
Py_CLEAR(m->func_globals);
Py_CLEAR(m->func_code);
Py_CLEAR(m->func_classobj);
Py_CLEAR(m->defaults_tuple);
Py_CLEAR(m->defaults_kwdict);
Py_CLEAR(m->func_annotations);
if (m->defaults) {
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
PyObject_GC_UnTrack(m);
if (__Pyx_CyFunction_weakreflist(m) != NULL)
PyObject_ClearWeakRefs((PyObject *) m);
__Pyx_CyFunction_clear(m);
PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
Py_VISIT(m->func_closure);
Py_VISIT(m->func.m_module);
Py_VISIT(m->func_dict);
Py_VISIT(m->func_name);
Py_VISIT(m->func_qualname);
Py_VISIT(m->func_doc);
Py_VISIT(m->func_globals);
Py_VISIT(m->func_code);
Py_VISIT(m->func_classobj);
Py_VISIT(m->defaults_tuple);
Py_VISIT(m->defaults_kwdict);
if (m->defaults) {
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_VISIT(pydefaults[i]);
}
return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
Py_INCREF(func);
return func;
}
if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
if (type == NULL)
type = (PyObject *)(Py_TYPE(obj));
return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
}
if (obj == Py_None)
obj = NULL;
return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat("<cyfunction %U at %p>",
op->func_qualname, (void *)op);
#else
return PyString_FromFormat("<cyfunction %s at %p>",
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
if (likely(kw == NULL || PyDict_Size(kw) == 0))
return (*meth)(self, arg);
break;
case METH_VARARGS | METH_KEYWORDS:
return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
case METH_NOARGS:
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
"%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
if (likely(size == 1)) {
PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0)) return NULL;
result = (*meth)(self, arg0);
Py_DECREF(arg0);
return result;
}
PyErr_Format(PyExc_TypeError,
"%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
default:
PyErr_SetString(PyExc_SystemError, "Bad call flags in "
"__Pyx_CyFunction_Call. METH_OLDARGS is no "
"longer supported!");
return NULL;
}
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
f->m_ml->ml_name);
return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
PyObject *result;
__pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
Py_ssize_t argc;
PyObject *new_args;
PyObject *self;
argc = PyTuple_GET_SIZE(args);
new_args = PyTuple_GetSlice(args, 1, argc);
if (unlikely(!new_args))
return NULL;
self = PyTuple_GetItem(args, 0);
if (unlikely(!self)) {
Py_DECREF(new_args);
return NULL;
}
result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
Py_DECREF(new_args);
} else {
result = __Pyx_CyFunction_Call(func, args, kw);
}
return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
sizeof(__pyx_CyFunctionObject),
0,
(destructor) __Pyx_CyFunction_dealloc,
0,
0,
0,
#if PY_MAJOR_VERSION < 3
0,
#else
0,
#endif
(reprfunc) __Pyx_CyFunction_repr,
0,
0,
0,
0,
__Pyx_CyFunction_CallAsMethod,
0,
0,
0,
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
0,
(traverseproc) __Pyx_CyFunction_traverse,
(inquiry) __Pyx_CyFunction_clear,
0,
#if PY_VERSION_HEX < 0x030500A0
offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
offsetof(PyCFunctionObject, m_weakreflist),
#endif
0,
0,
__pyx_CyFunction_methods,
__pyx_CyFunction_members,
__pyx_CyFunction_getsets,
0,
0,
__Pyx_CyFunction_descr_get,
0,
offsetof(__pyx_CyFunctionObject, func_dict),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
#if PY_VERSION_HEX >= 0x030400a1
0,
#endif
};
static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL) {
return -1;
}
return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults = PyObject_Malloc(size);
if (!m->defaults)
return PyErr_NoMemory();
memset(m->defaults, 0, size);
m->defaults_pyobjects = pyobjects;
return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults_tuple = tuple;
Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->defaults_kwdict = dict;
Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
m->func_annotations = dict;
Py_INCREF(dict);
}
/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
start = mid + 1;
} else {
return mid;
}
}
if (code_line <= entries[mid].code_line) {
return mid;
} else {
return mid + 1;
}
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
PyCodeObject* code_object;
int pos;
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
return NULL;
}
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
return NULL;
}
code_object = __pyx_code_cache.entries[pos].code_object;
Py_INCREF(code_object);
return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
int pos, i;
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
if (unlikely(!code_line)) {
return;
}
if (unlikely(!entries)) {
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
if (likely(entries)) {
__pyx_code_cache.entries = entries;
__pyx_code_cache.max_count = 64;
__pyx_code_cache.count = 1;
entries[0].code_line = code_line;
entries[0].code_object = code_object;
Py_INCREF(code_object);
}
return;
}
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
PyCodeObject* tmp = entries[pos].code_object;
entries[pos].code_object = code_object;
Py_DECREF(tmp);
return;
}
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
int new_max = __pyx_code_cache.max_count + 64;
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
__pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
if (unlikely(!entries)) {
return;
}
__pyx_code_cache.entries = entries;
__pyx_code_cache.max_count = new_max;
}
for (i=__pyx_code_cache.count; i>pos; i--) {
entries[i] = entries[i-1];
}
entries[pos].code_line = code_line;
entries[pos].code_object = code_object;
__pyx_code_cache.count++;
Py_INCREF(code_object);
}
/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
const char *funcname, int c_line,
int py_line, const char *filename) {
PyCodeObject *py_code = 0;
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
#if PY_MAJOR_VERSION < 3
py_srcfile = PyString_FromString(filename);
#else
py_srcfile = PyUnicode_FromString(filename);
#endif
if (!py_srcfile) goto bad;
if (c_line) {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#else
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
#endif
}
else {
#if PY_MAJOR_VERSION < 3
py_funcname = PyString_FromString(funcname);
#else
py_funcname = PyUnicode_FromString(funcname);
#endif
}
if (!py_funcname) goto bad;
py_code = __Pyx_PyCode_New(
0,
0,
0,
0,
0,
__pyx_empty_bytes, /*PyObject *code,*/
__pyx_empty_tuple, /*PyObject *consts,*/
__pyx_empty_tuple, /*PyObject *names,*/
__pyx_empty_tuple, /*PyObject *varnames,*/
__pyx_empty_tuple, /*PyObject *freevars,*/
__pyx_empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
py_line,
__pyx_empty_bytes /*PyObject *lnotab*/
);
Py_DECREF(py_srcfile);
Py_DECREF(py_funcname);
return py_code;
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename) {
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_code = __pyx_find_code_object(c_line ? c_line : py_line);
if (!py_code) {
py_code = __Pyx_CreateCodeObjectForTraceback(
funcname, c_line, py_line, filename);
if (!py_code) goto bad;
__pyx_insert_code_object(c_line ? c_line : py_line, py_code);
}
py_frame = PyFrame_New(
PyThreadState_GET(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
__pyx_d, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(int),
little, !is_unsigned);
}
}
/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
{\
func_type value = func_value;\
if (sizeof(target_type) < sizeof(func_type)) {\
if (unlikely(value != (func_type) (target_type) value)) {\
func_type zero = 0;\
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
return (target_type) -1;\
if (is_unsigned && unlikely(value < zero))\
goto raise_neg_overflow;\
else\
goto raise_overflow;\
}\
}\
return (target_type) value;\
}
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
return _PyLong_FromByteArray(bytes, sizeof(long),
little, !is_unsigned);
}
}
/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(int) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (int) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (int) 0;
case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
case 2:
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (int) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(int) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (int) 0;
case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
case -2:
if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
}
}
break;
}
#endif
if (sizeof(int) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (int) -1;
}
} else {
int val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to int");
return (int) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to int");
return (int) -1;
}
/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
if (sizeof(long) < sizeof(long)) {
__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
return (long) val;
}
} else
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (long) 0;
case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
case 2:
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
case 3:
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
case 4:
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
}
}
break;
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
#else
{
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
if (unlikely(result < 0))
return (long) -1;
if (unlikely(result == 1))
goto raise_neg_overflow;
}
#endif
if (sizeof(long) <= sizeof(unsigned long)) {
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
}
} else {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
case 0: return (long) 0;
case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
case -2:
if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 2:
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case -3:
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 3:
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case -4:
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
case 4:
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
}
}
break;
}
#endif
if (sizeof(long) <= sizeof(long)) {
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
}
}
{
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
v = PyNumber_Long(tmp);
Py_DECREF(tmp);
}
#endif
if (likely(v)) {
int one = 1; int is_little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&val;
int ret = _PyLong_AsByteArray((PyLongObject *)v,
bytes, sizeof(val),
is_little, !is_unsigned);
Py_DECREF(v);
if (likely(!ret))
return val;
}
#endif
return (long) -1;
}
} else {
long val;
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to long");
return (long) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to long");
return (long) -1;
}
/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
char message[200];
PyOS_snprintf(message, sizeof(message),
"compiletime version %s of module '%.100s' "
"does not match runtime version %s",
ctversion, __Pyx_MODULE_NAME, rtversion);
return PyErr_WarnEx(NULL, message, 1);
}
return 0;
}
/* VoidPtrExport */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
PyObject *d;
PyObject *cobj = 0;
d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
Py_XINCREF(d);
if (!d) {
d = PyDict_New();
if (!d)
goto bad;
if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
goto bad;
}
#if PY_VERSION_HEX >= 0x02070000
cobj = PyCapsule_New(p, sig, 0);
#else
cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
#endif
if (!cobj)
goto bad;
if (PyDict_SetItem(d, name, cobj) < 0)
goto bad;
Py_DECREF(cobj);
Py_DECREF(d);
return 0;
bad:
Py_XDECREF(cobj);
Py_XDECREF(d);
return -1;
}
/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
PyObject *d = 0;
PyObject *cobj = 0;
union {
void (*fp)(void);
void *p;
} tmp;
d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
if (!d) {
PyErr_Clear();
d = PyDict_New();
if (!d)
goto bad;
Py_INCREF(d);
if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
goto bad;
}
tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
cobj = PyCapsule_New(tmp.p, sig, 0);
#else
cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
if (!cobj)
goto bad;
if (PyDict_SetItemString(d, name, cobj) < 0)
goto bad;
Py_DECREF(cobj);
Py_DECREF(d);
return 0;
bad:
Py_XDECREF(cobj);
Py_XDECREF(d);
return -1;
}
/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else if (t->intern) {
*t->p = PyString_InternFromString(t->s);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
#else
if (t->is_unicode | t->is_str) {
if (t->intern) {
*t->p = PyUnicode_InternFromString(t->s);
} else if (t->encoding) {
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
} else {
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
}
} else {
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
}
#endif
if (!*t->p)
return -1;
++t;
}
return 0;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
Py_ssize_t ignore;
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
#endif
PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
char* defenc_c;
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
if (!defenc) return NULL;
defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
{
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
char* c;
for (c = defenc_c; c < end; c++) {
if ((unsigned char) (*c) >= 128) {
PyUnicode_AsASCIIString(o);
return NULL;
}
}
}
#endif
*length = PyBytes_GET_SIZE(defenc);
return defenc_c;
#else
if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
if (PyUnicode_IS_ASCII(o)) {
*length = PyUnicode_GET_LENGTH(o);
return PyUnicode_AsUTF8(o);
} else {
PyUnicode_AsASCIIString(o);
return NULL;
}
#else
return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
} else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
} else
#endif
{
char* result;
int r = PyBytes_AsStringAndSize(o, &result, length);
if (unlikely(r < 0)) {
return NULL;
} else {
return result;
}
}
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
int is_true = x == Py_True;
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
if (PyInt_Check(x) || PyLong_Check(x))
#else
if (PyLong_Check(x))
#endif
return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
}
else if (m && m->nb_long) {
name = "long";
res = PyNumber_Long(x);
}
#else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
#endif
#else
res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
if (!PyLong_Check(res)) {
#endif
PyErr_Format(PyExc_TypeError,
"__%.4s__ returned non-%.4s (type %.200s)",
name, name, Py_TYPE(res)->tp_name);
Py_DECREF(res);
return NULL;
}
}
else if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
"an integer is required");
}
return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject *x;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_CheckExact(b))) {
if (sizeof(Py_ssize_t) >= sizeof(long))
return PyInt_AS_LONG(b);
else
return PyInt_AsSsize_t(x);
}
#endif
if (likely(PyLong_CheckExact(b))) {
#if CYTHON_USE_PYLONG_INTERNALS
const digit* digits = ((PyLongObject*)b)->ob_digit;
const Py_ssize_t size = Py_SIZE(b);
if (likely(__Pyx_sst_abs(size) <= 1)) {
ival = likely(size) ? digits[0] : 0;
if (size == -1) ival = -ival;
return ival;
} else {
switch (size) {
case 2:
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -2:
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case 3:
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -3:
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case 4:
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
case -4:
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
}
break;
}
}
#endif
return PyLong_AsSsize_t(b);
}
x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
return PyInt_FromSize_t(ival);
}
#endif /* Py_PYTHON_H */