14 #include "../generic/py_capi_utils.h"
15 #include "../generic/python_utildefines.h"
19 #ifndef MATH_STANDALONE
46 PyTuple_SET_ITEM(
ret, i, PyFloat_FromDouble(
self->col[i]));
59 static PyObject *
Color_new(PyTypeObject *
type, PyObject *args, PyObject *kwds)
61 float col[3] = {0.0f, 0.0f, 0.0f};
63 if (kwds && PyDict_Size(kwds)) {
64 PyErr_SetString(PyExc_TypeError,
66 "takes no keyword args");
70 switch (PyTuple_GET_SIZE(args)) {
81 PyErr_SetString(PyExc_TypeError,
83 "more than a single arg given");
96 ".. function:: from_scene_linear_to_srgb()\n"
98 " Convert from scene linear to sRGB color space.\n"
100 " :return: A color in sRGB color space.\n"
101 " :rtype: :class:`Color`\n");
110 ".. function:: from_srgb_to_scene_linear()\n"
112 " Convert from sRGB to scene linear color space.\n"
114 " :return: A color in scene linear color space.\n"
115 " :rtype: :class:`Color`\n");
124 ".. function:: from_scene_linear_to_xyz_d65()\n"
126 " Convert from scene linear to CIE XYZ (Illuminant D65) color space.\n"
128 " :return: A color in XYZ color space.\n"
129 " :rtype: :class:`Color`\n");
138 ".. function:: from_xyz_d65_to_scene_linear()\n"
140 " Convert from CIE XYZ (Illuminant D65) to scene linear color space.\n"
142 " :return: A color in scene linear color space.\n"
143 " :rtype: :class:`Color`\n");
152 ".. function:: from_scene_linear_to_aces()\n"
154 " Convert from scene linear to ACES2065-1 linear color space.\n"
156 " :return: A color in ACES2065-1 linear color space.\n"
157 " :rtype: :class:`Color`\n");
166 ".. function:: from_aces_to_scene_linear()\n"
168 " Convert from ACES2065-1 linear to scene linear color space.\n"
170 " :return: A color in scene linear color space.\n"
171 " :rtype: :class:`Color`\n");
180 ".. function:: from_scene_linear_to_rec709_linear()\n"
182 " Convert from scene linear to Rec.709 linear color space.\n"
184 " :return: A color in Rec.709 linear color space.\n"
185 " :rtype: :class:`Color`\n");
194 ".. function:: from_rec709_linear_to_scene_linear()\n"
196 " Convert from Rec.709 linear color space to scene linear color space.\n"
198 " :return: A color in scene linear color space.\n"
199 " :rtype: :class:`Color`\n");
214 ".. function:: copy()\n"
216 " Returns a copy of this color.\n"
218 " :return: A copy of the color.\n"
219 " :rtype: :class:`Color`\n"
221 " .. note:: use this to get a copy of a wrapped color with\n"
222 " no reference to the original data.\n");
247 PyObject *
ret, *tuple;
255 ret = PyUnicode_FromFormat(
"Color(%R)", tuple);
261 #ifndef MATH_STANDALONE
273 ds,
"<Color (r=%.4f, g=%.4f, b=%.4f)>",
self->col[0],
self->col[1],
self->col[2]);
306 res = ok ? Py_False : Py_True;
313 res = Py_NotImplemented;
320 return Py_INCREF_RET(res);
362 PyErr_SetString(PyExc_IndexError,
364 "array index out of range");
372 return PyFloat_FromDouble(
self->col[i]);
384 f = PyFloat_AsDouble(value);
385 if (f == -1 && PyErr_Occurred()) {
386 PyErr_SetString(PyExc_TypeError,
388 "assigned value not a number");
397 PyErr_SetString(PyExc_IndexError,
399 "array assignment index out of range");
427 begin =
MIN2(begin, end);
429 tuple = PyTuple_New(end - begin);
431 PyTuple_SET_ITEM(tuple,
count - begin, PyFloat_FromDouble(
self->col[
count]));
452 begin =
MIN2(begin, end);
459 if (
size != (end - begin)) {
460 PyErr_SetString(PyExc_ValueError,
461 "color[begin:end] = []: "
462 "size mismatch in slice assignment");
467 self->col[begin + i] =
col[i];
477 if (PyIndex_Check(item)) {
479 i = PyNumber_AsSsize_t(item, PyExc_IndexError);
480 if (i == -1 && PyErr_Occurred()) {
488 if (PySlice_Check(item)) {
489 Py_ssize_t start, stop, step, slicelength;
491 if (PySlice_GetIndicesEx(item,
COLOR_SIZE, &start, &stop, &step, &slicelength) < 0) {
495 if (slicelength <= 0) {
496 return PyTuple_New(0);
502 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with color");
507 PyExc_TypeError,
"color indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
514 if (PyIndex_Check(item)) {
515 Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
516 if (i == -1 && PyErr_Occurred()) {
524 if (PySlice_Check(item)) {
525 Py_ssize_t start, stop, step, slicelength;
527 if (PySlice_GetIndicesEx(item,
COLOR_SIZE, &start, &stop, &step, &slicelength) < 0) {
535 PyErr_SetString(PyExc_IndexError,
"slice steps not supported with color");
540 PyExc_TypeError,
"color indices must be integers, not %.200s", Py_TYPE(item)->tp_name);
557 PyErr_Format(PyExc_TypeError,
558 "Color addition: (%s + %s) "
559 "invalid type for this operation",
560 Py_TYPE(
v1)->tp_name,
561 Py_TYPE(
v2)->tp_name);
582 PyErr_Format(PyExc_TypeError,
583 "Color addition: (%s += %s) "
584 "invalid type for this operation",
585 Py_TYPE(
v1)->tp_name,
586 Py_TYPE(
v2)->tp_name);
610 PyErr_Format(PyExc_TypeError,
611 "Color subtraction: (%s - %s) "
612 "invalid type for this operation",
613 Py_TYPE(
v1)->tp_name,
614 Py_TYPE(
v2)->tp_name);
635 PyErr_Format(PyExc_TypeError,
636 "Color subtraction: (%s -= %s) "
637 "invalid type for this operation",
638 Py_TYPE(
v1)->tp_name,
639 Py_TYPE(
v2)->tp_name);
683 if (color1 && color2) {
687 if (((scalar = PyFloat_AsDouble(
v2)) == -1.0f && PyErr_Occurred()) == 0) {
692 if (((scalar = PyFloat_AsDouble(
v1)) == -1.0f && PyErr_Occurred()) == 0) {
700 PyErr_Format(PyExc_TypeError,
701 "Color multiplication: not supported between "
702 "'%.200s' and '%.200s' types",
703 Py_TYPE(
v1)->tp_name,
704 Py_TYPE(
v2)->tp_name);
721 PyErr_SetString(PyExc_TypeError,
"Color division not supported in this order");
726 if (((scalar = PyFloat_AsDouble(
v2)) == -1.0f && PyErr_Occurred()) == 0) {
727 if (scalar == 0.0f) {
728 PyErr_SetString(PyExc_ZeroDivisionError,
"Color division: divide by zero error");
734 PyErr_Format(PyExc_TypeError,
735 "Color multiplication: not supported between "
736 "'%.200s' and '%.200s' types",
737 Py_TYPE(
v1)->tp_name,
738 Py_TYPE(
v2)->tp_name);
753 if (((scalar = PyFloat_AsDouble(
v2)) == -1.0f && PyErr_Occurred()) == 0) {
757 PyErr_Format(PyExc_TypeError,
758 "Color multiplication: (%s *= %s) "
759 "invalid type for this operation",
760 Py_TYPE(
v1)->tp_name,
761 Py_TYPE(
v2)->tp_name);
781 if (((scalar = PyFloat_AsDouble(
v2)) == -1.0f && PyErr_Occurred()) == 0) {
782 if (scalar == 0.0f) {
783 PyErr_SetString(PyExc_ZeroDivisionError,
"Color division: divide by zero error");
790 PyErr_Format(PyExc_TypeError,
791 "Color division: (%s /= %s) "
792 "invalid type for this operation",
793 Py_TYPE(
v1)->tp_name,
794 Py_TYPE(
v2)->tp_name);
886 PyDoc_STRVAR(Color_channel_r_doc,
"Red color channel.\n\n:type: float");
887 PyDoc_STRVAR(Color_channel_g_doc,
"Green color channel.\n\n:type: float");
888 PyDoc_STRVAR(Color_channel_b_doc,
"Blue color channel.\n\n:type: float");
902 PyDoc_STRVAR(Color_channel_hsv_h_doc,
"HSV Hue component in [0, 1].\n\n:type: float");
903 PyDoc_STRVAR(Color_channel_hsv_s_doc,
"HSV Saturation component in [0, 1].\n\n:type: float");
904 PyDoc_STRVAR(Color_channel_hsv_v_doc,
"HSV Value component in [0, 1].\n\n:type: float");
917 return PyFloat_FromDouble(hsv[i]);
924 float f = PyFloat_AsDouble(value);
926 if (f == -1 && PyErr_Occurred()) {
927 PyErr_SetString(PyExc_TypeError,
928 "color.h/s/v = value: "
929 "assigned value not a number");
938 CLAMP(f, 0.0f, 1.0f);
949 PyDoc_STRVAR(Color_hsv_doc,
"HSV Values in [0, 1].\n\n:type: float triplet");
962 ret = PyTuple_New(3);
964 ret, PyFloat_FromDouble(hsv[0]), PyFloat_FromDouble(hsv[1]), PyFloat_FromDouble(hsv[2]));
1005 Color_channel_hsv_h_doc,
1010 Color_channel_hsv_s_doc,
1015 Color_channel_hsv_v_doc,
1046 {
"copy", (PyCFunction)
Color_copy, METH_NOARGS, Color_copy_doc},
1047 {
"__copy__", (PyCFunction)
Color_copy, METH_NOARGS, Color_copy_doc},
1048 {
"__deepcopy__", (PyCFunction)
Color_deepcopy, METH_VARARGS, Color_copy_doc},
1054 {
"from_scene_linear_to_srgb",
1057 Color_from_scene_linear_to_srgb_doc},
1058 {
"from_srgb_to_scene_linear",
1061 Color_from_srgb_to_scene_linear_doc},
1062 {
"from_scene_linear_to_xyz_d65",
1065 Color_from_scene_linear_to_xyz_d65_doc},
1066 {
"from_xyz_d65_to_scene_linear",
1069 Color_from_xyz_d65_to_scene_linear_doc},
1070 {
"from_scene_linear_to_aces",
1073 Color_from_scene_linear_to_aces_doc},
1074 {
"from_aces_to_scene_linear",
1077 Color_from_aces_to_scene_linear_doc},
1078 {
"from_scene_linear_to_rec709_linear",
1081 Color_from_scene_linear_to_rec709_linear_doc},
1082 {
"from_rec709_linear_to_scene_linear",
1085 Color_from_rec709_linear_to_scene_linear_doc},
1097 ".. class:: Color(rgb)\n"
1099 " This object gives access to Colors in Blender.\n"
1101 " Most colors returned by Blender APIs are in scene linear color space, as defined by "
1102 " the OpenColorIO configuration. The notable exception is user interface theming colors, "
1103 " which are in sRGB color space.\n"
1105 " :param rgb: (r, g, b) color values\n"
1106 " :type rgb: 3d vector\n");
1108 PyVarObject_HEAD_INIT(
NULL, 0)
"Color",
1122 #ifndef MATH_STANDALONE
1130 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
1170 col_alloc = PyMem_Malloc(
COLOR_SIZE *
sizeof(
float));
1172 PyErr_SetString(PyExc_MemoryError,
1174 "problem allocating data");
1180 self->col = col_alloc;
1183 self->cb_user =
NULL;
1184 self->cb_type =
self->cb_subtype = 0;
1197 PyMem_Free(col_alloc);
1200 return (PyObject *)
self;
1210 self->cb_user =
NULL;
1211 self->cb_type =
self->cb_subtype = 0;
1218 return (PyObject *)
self;
1226 self->cb_user = cb_user;
1227 self->cb_type = cb_type;
1228 self->cb_subtype = cb_subtype;
1229 PyObject_GC_Track(
self);
1232 return (PyObject *)
self;
#define BLI_assert_msg(a, msg)
A dynamically sized string ADT.
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
double double_round(double x, int ndigits)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void add_vn_vn(float *array_tar, const float *array_src, int size)
void mul_vn_fl(float *array_tar, int size, float f)
MINLINE void clamp_v3(float vec[3], float min, float max)
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, int size)
void negate_vn_vn(float *array_tar, const float *array_src, int size)
MINLINE void zero_v3(float r[3])
void mul_vn_vn_fl(float *array_tar, const float *array_src, int size, float f)
void sub_vn_vn(float *array_tar, const float *array_src, int size)
#define POINTER_AS_INT(i)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3(float scene_linear[3], const float srgb[3])
BLI_INLINE void IMB_colormanagement_scene_linear_to_rec709(float rec709[3], const float scene_linear[3])
BLI_INLINE void IMB_colormanagement_aces_to_scene_linear(float scene_linear[3], const float aces[3])
BLI_INLINE void IMB_colormanagement_xyz_to_scene_linear(float scene_linear[3], const float xyz[3])
BLI_INLINE void IMB_colormanagement_rec709_to_scene_linear(float scene_linear[3], const float rec709[3])
BLI_INLINE void IMB_colormanagement_scene_linear_to_xyz(float xyz[3], const float scene_linear[3])
BLI_INLINE void IMB_colormanagement_scene_linear_to_aces(float aces[3], const float scene_linear[3])
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3(float srgb[3], const float scene_linear[3])
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SyclQueue void void size_t num_bytes void
PyObject * BaseMathObject_freeze(BaseMathObject *self)
PyObject * BaseMathObject_is_frozen_get(BaseMathObject *self, void *UNUSED(closure))
PyObject * BaseMathObject_is_wrapped_get(BaseMathObject *self, void *UNUSED(closure))
PyObject * mathutils_dynstr_to_py(struct DynStr *ds)
Py_hash_t mathutils_array_hash(const float *array, size_t array_len)
void BaseMathObject_dealloc(BaseMathObject *self)
int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
char BaseMathObject_is_valid_doc[]
PyObject * BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure))
char BaseMathObject_is_wrapped_doc[]
char BaseMathObject_is_frozen_doc[]
PyObject * BaseMathObject_is_valid_get(BaseMathObject *self, void *UNUSED(closure))
char BaseMathObject_owner_doc[]
char BaseMathObject_freeze_doc[]
int BaseMathObject_clear(BaseMathObject *self)
int BaseMathObject_traverse(BaseMathObject *self, visitproc visit, void *arg)
#define BaseMath_ReadCallback_ForWrite(_self)
#define BaseMath_ReadIndexCallback(_self, _index)
#define BaseMath_WriteCallback(_self)
#define BASE_MATH_NEW(struct_name, root_type, base_type)
#define BaseMathObject_Prepare_ForHash(_self)
#define BASE_MATH_FLAG_DEFAULT
#define BaseMath_Prepare_ForWrite(_self)
#define BaseMath_ReadCallback(_self)
#define BaseMath_WriteIndexCallback(_self, _index)
static PyObject * Color_subscript(ColorObject *self, PyObject *item)
static Py_hash_t Color_hash(ColorObject *self)
static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *value)
static PyObject * Color_copy(ColorObject *self)
static PyObject * Color_from_xyz_d65_to_scene_linear(ColorObject *self)
static PyObject * Color_channel_hsv_get(ColorObject *self, void *type)
static PyObject * Color_channel_get(ColorObject *self, void *type)
static PySequenceMethods Color_SeqMethods
static PyObject * Color_div(PyObject *v1, PyObject *v2)
static PyObject * Color_slice(ColorObject *self, int begin, int end)
PyDoc_STRVAR(Color_from_scene_linear_to_srgb_doc, ".. function:: from_scene_linear_to_srgb()\n" "\n" " Convert from scene linear to sRGB color space.\n" "\n" " :return: A color in sRGB color space.\n" " :rtype: :class:`Color`\n")
static PyGetSetDef Color_getseters[]
static PyObject * Color_mul(PyObject *v1, PyObject *v2)
static PyObject * Color_imul(PyObject *v1, PyObject *v2)
static PyObject * Color_from_rec709_linear_to_scene_linear(ColorObject *self)
PyObject * Color_CreatePyObject_cb(PyObject *cb_user, uchar cb_type, uchar cb_subtype)
static PyObject * Color_sub(PyObject *v1, PyObject *v2)
static PyObject * Color_to_tuple_ex(ColorObject *self, int ndigits)
static PyObject * Color_neg(ColorObject *self)
static PyObject * Color_from_scene_linear_to_srgb(ColorObject *self)
static PyNumberMethods Color_NumMethods
static PyObject * Color_richcmpr(PyObject *a, PyObject *b, int op)
PyObject * Color_CreatePyObject(const float col[3], PyTypeObject *base_type)
static int Color_ass_slice(ColorObject *self, int begin, int end, PyObject *seq)
PyObject * Color_CreatePyObject_wrap(float col[3], PyTypeObject *base_type)
static PyObject * Color_str(ColorObject *self)
static PyObject * Color_repr(ColorObject *self)
static PyObject * Color_from_scene_linear_to_rec709_linear(ColorObject *self)
static PyObject * Color_from_scene_linear_to_aces(ColorObject *self)
static int Color_hsv_set(ColorObject *self, PyObject *value, void *UNUSED(closure))
static PyObject * Color_from_aces_to_scene_linear(ColorObject *self)
static struct PyMethodDef Color_methods[]
static PyObject * Color_iadd(PyObject *v1, PyObject *v2)
static PyObject * Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static PyMappingMethods Color_AsMapping
static PyObject * Color_add(PyObject *v1, PyObject *v2)
static PyObject * Color_item(ColorObject *self, int i)
static int Color_ass_item(ColorObject *self, int i, PyObject *value)
static PyObject * Color_idiv(PyObject *v1, PyObject *v2)
static PyObject * Color_deepcopy(ColorObject *self, PyObject *args)
static int Color_channel_set(ColorObject *self, PyObject *value, void *type)
static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void *type)
static PyObject * Color_isub(PyObject *v1, PyObject *v2)
static PyObject * Color_from_srgb_to_scene_linear(ColorObject *self)
static int Color_len(ColorObject *UNUSED(self))
static PyObject * color_mul_float(ColorObject *color, const float scalar)
static PyObject * Color_from_scene_linear_to_xyz_d65(ColorObject *self)
static PyObject * Color_hsv_get(ColorObject *self, void *UNUSED(closure))
#define ColorObject_Check(v)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
int PyC_CheckArgs_DeepCopy(PyObject *args)
#define PyTuple_SET_ITEMS(op_arg,...)