Expose C extension variants of function wrapper base and bound wrapper classes to allow customisation in pure Python code.
This commit is contained in:
@@ -2044,6 +2044,16 @@ moduleinit(void)
|
||||
PyModule_AddObject(module, "FunctionWrapper",
|
||||
(PyObject *)&WraptFunctionWrapper_Type);
|
||||
|
||||
Py_INCREF(&WraptFunctionWrapperBase_Type);
|
||||
PyModule_AddObject(module, "_FunctionWrapperBase",
|
||||
(PyObject *)&WraptFunctionWrapperBase_Type);
|
||||
Py_INCREF(&WraptBoundFunctionWrapper_Type);
|
||||
PyModule_AddObject(module, "_BoundFunctionWrapper",
|
||||
(PyObject *)&WraptBoundFunctionWrapper_Type);
|
||||
Py_INCREF(&WraptBoundMethodWrapper_Type);
|
||||
PyModule_AddObject(module, "_BoundMethodWrapper",
|
||||
(PyObject *)&WraptBoundMethodWrapper_Type);
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
@@ -509,7 +509,8 @@ class FunctionWrapper(_FunctionWrapperBase):
|
||||
adapter, bound_type)
|
||||
|
||||
try:
|
||||
from ._wrappers import ObjectProxy, FunctionWrapper
|
||||
from ._wrappers import (ObjectProxy, FunctionWrapper,
|
||||
_FunctionWrapperBase, _BoundFunctionWrapper, _BoundMethodWrapper)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user