Expose C extension variants of function wrapper base and bound wrapper classes to allow customisation in pure Python code.

This commit is contained in:
Graham Dumpleton
2013-09-17 21:46:22 +10:00
parent 8d83f729ed
commit a6651e8a71
2 changed files with 12 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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