support unary positive operators for vectors (same as numpy), so you can do 'vector_a = +vector_b', this makes a copy.
This commit is contained in:
@@ -644,8 +644,8 @@ static PyNumberMethods Color_NumMethods = {
|
||||
NULL, /*nb_remainder*/
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc) Color_neg, /*nb_negative*/
|
||||
(unaryfunc) NULL, /*tp_positive*/
|
||||
(unaryfunc) Color_neg, /*nb_negative*/
|
||||
(unaryfunc) Color_copy, /*tp_positive*/
|
||||
(unaryfunc) NULL, /*tp_absolute*/
|
||||
(inquiry) NULL, /*tp_bool*/
|
||||
(unaryfunc) NULL, /*nb_invert*/
|
||||
|
||||
@@ -903,7 +903,7 @@ static PyNumberMethods Quaternion_NumMethods = {
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc) Quaternion_neg, /*nb_negative*/
|
||||
(unaryfunc) 0, /*tp_positive*/
|
||||
(unaryfunc) Quaternion_copy,/*tp_positive*/
|
||||
(unaryfunc) 0, /*tp_absolute*/
|
||||
(inquiry) 0, /*tp_bool*/
|
||||
(unaryfunc) 0, /*nb_invert*/
|
||||
|
||||
@@ -2046,7 +2046,7 @@ static PyNumberMethods Vector_NumMethods = {
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc) Vector_neg, /*nb_negative*/
|
||||
(unaryfunc) NULL, /*tp_positive*/
|
||||
(unaryfunc) Vector_copy,/*tp_positive*/
|
||||
(unaryfunc) NULL, /*tp_absolute*/
|
||||
(inquiry) NULL, /*tp_bool*/
|
||||
(unaryfunc) NULL, /*nb_invert*/
|
||||
|
||||
Reference in New Issue
Block a user