wrapt 2.0.0rc4__cp313-cp313-musllinux_1_2_riscv64.whl → 2.0.1__cp313-cp313-musllinux_1_2_riscv64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wrapt/__init__.py +2 -1
- wrapt/__init__.pyi +8 -1
- wrapt/__wrapt__.py +4 -0
- wrapt/_wrappers.c +555 -91
- wrapt/_wrappers.cpython-313-riscv64-linux-musl.so +0 -0
- wrapt/proxies.py +105 -20
- wrapt/wrappers.py +70 -25
- wrapt-2.0.1.dist-info/METADATA +216 -0
- wrapt-2.0.1.dist-info/RECORD +18 -0
- wrapt-2.0.0rc4.dist-info/METADATA +0 -198
- wrapt-2.0.0rc4.dist-info/RECORD +0 -18
- {wrapt-2.0.0rc4.dist-info → wrapt-2.0.1.dist-info}/WHEEL +0 -0
- {wrapt-2.0.0rc4.dist-info → wrapt-2.0.1.dist-info}/licenses/LICENSE +0 -0
- {wrapt-2.0.0rc4.dist-info → wrapt-2.0.1.dist-info}/top_level.txt +0 -0
wrapt/_wrappers.c
CHANGED
|
@@ -798,16 +798,51 @@ static PyObject *WraptObjectProxy_inplace_add(WraptObjectProxyObject *self,
|
|
|
798
798
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
799
799
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
800
800
|
|
|
801
|
-
|
|
801
|
+
if (PyObject_HasAttrString(self->wrapped, "__iadd__"))
|
|
802
|
+
{
|
|
803
|
+
object = PyNumber_InPlaceAdd(self->wrapped, other);
|
|
802
804
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
+
if (!object)
|
|
806
|
+
return NULL;
|
|
805
807
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
+
Py_DECREF(self->wrapped);
|
|
809
|
+
self->wrapped = object;
|
|
808
810
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
+
Py_INCREF(self);
|
|
812
|
+
return (PyObject *)self;
|
|
813
|
+
}
|
|
814
|
+
else
|
|
815
|
+
{
|
|
816
|
+
PyObject *result = PyNumber_Add(self->wrapped, other);
|
|
817
|
+
|
|
818
|
+
if (!result)
|
|
819
|
+
return NULL;
|
|
820
|
+
|
|
821
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
822
|
+
|
|
823
|
+
if (!proxy_type)
|
|
824
|
+
{
|
|
825
|
+
Py_DECREF(proxy_type);
|
|
826
|
+
return NULL;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
830
|
+
|
|
831
|
+
Py_DECREF(result);
|
|
832
|
+
|
|
833
|
+
if (!proxy_args)
|
|
834
|
+
{
|
|
835
|
+
Py_DECREF(proxy_type);
|
|
836
|
+
return NULL;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
840
|
+
|
|
841
|
+
Py_DECREF(proxy_type);
|
|
842
|
+
Py_DECREF(proxy_args);
|
|
843
|
+
|
|
844
|
+
return proxy_instance;
|
|
845
|
+
}
|
|
811
846
|
}
|
|
812
847
|
|
|
813
848
|
/* ------------------------------------------------------------------------- */
|
|
@@ -826,16 +861,51 @@ static PyObject *WraptObjectProxy_inplace_subtract(WraptObjectProxyObject *self,
|
|
|
826
861
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
827
862
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
828
863
|
|
|
829
|
-
|
|
864
|
+
if (PyObject_HasAttrString(self->wrapped, "__isub__"))
|
|
865
|
+
{
|
|
866
|
+
object = PyNumber_InPlaceSubtract(self->wrapped, other);
|
|
830
867
|
|
|
831
|
-
|
|
832
|
-
|
|
868
|
+
if (!object)
|
|
869
|
+
return NULL;
|
|
833
870
|
|
|
834
|
-
|
|
835
|
-
|
|
871
|
+
Py_DECREF(self->wrapped);
|
|
872
|
+
self->wrapped = object;
|
|
836
873
|
|
|
837
|
-
|
|
838
|
-
|
|
874
|
+
Py_INCREF(self);
|
|
875
|
+
return (PyObject *)self;
|
|
876
|
+
}
|
|
877
|
+
else
|
|
878
|
+
{
|
|
879
|
+
PyObject *result = PyNumber_Subtract(self->wrapped, other);
|
|
880
|
+
|
|
881
|
+
if (!result)
|
|
882
|
+
return NULL;
|
|
883
|
+
|
|
884
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
885
|
+
|
|
886
|
+
if (!proxy_type)
|
|
887
|
+
{
|
|
888
|
+
Py_DECREF(proxy_type);
|
|
889
|
+
return NULL;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
893
|
+
|
|
894
|
+
Py_DECREF(result);
|
|
895
|
+
|
|
896
|
+
if (!proxy_args)
|
|
897
|
+
{
|
|
898
|
+
Py_DECREF(proxy_type);
|
|
899
|
+
return NULL;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
903
|
+
|
|
904
|
+
Py_DECREF(proxy_type);
|
|
905
|
+
Py_DECREF(proxy_args);
|
|
906
|
+
|
|
907
|
+
return proxy_instance;
|
|
908
|
+
}
|
|
839
909
|
}
|
|
840
910
|
|
|
841
911
|
/* ------------------------------------------------------------------------- */
|
|
@@ -854,16 +924,51 @@ static PyObject *WraptObjectProxy_inplace_multiply(WraptObjectProxyObject *self,
|
|
|
854
924
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
855
925
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
856
926
|
|
|
857
|
-
|
|
927
|
+
if (PyObject_HasAttrString(self->wrapped, "__imul__"))
|
|
928
|
+
{
|
|
929
|
+
object = PyNumber_InPlaceMultiply(self->wrapped, other);
|
|
858
930
|
|
|
859
|
-
|
|
860
|
-
|
|
931
|
+
if (!object)
|
|
932
|
+
return NULL;
|
|
861
933
|
|
|
862
|
-
|
|
863
|
-
|
|
934
|
+
Py_DECREF(self->wrapped);
|
|
935
|
+
self->wrapped = object;
|
|
864
936
|
|
|
865
|
-
|
|
866
|
-
|
|
937
|
+
Py_INCREF(self);
|
|
938
|
+
return (PyObject *)self;
|
|
939
|
+
}
|
|
940
|
+
else
|
|
941
|
+
{
|
|
942
|
+
PyObject *result = PyNumber_Multiply(self->wrapped, other);
|
|
943
|
+
|
|
944
|
+
if (!result)
|
|
945
|
+
return NULL;
|
|
946
|
+
|
|
947
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
948
|
+
|
|
949
|
+
if (!proxy_type)
|
|
950
|
+
{
|
|
951
|
+
Py_DECREF(proxy_type);
|
|
952
|
+
return NULL;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
956
|
+
|
|
957
|
+
Py_DECREF(result);
|
|
958
|
+
|
|
959
|
+
if (!proxy_args)
|
|
960
|
+
{
|
|
961
|
+
Py_DECREF(proxy_type);
|
|
962
|
+
return NULL;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
966
|
+
|
|
967
|
+
Py_DECREF(proxy_type);
|
|
968
|
+
Py_DECREF(proxy_args);
|
|
969
|
+
|
|
970
|
+
return proxy_instance;
|
|
971
|
+
}
|
|
867
972
|
}
|
|
868
973
|
|
|
869
974
|
/* ------------------------------------------------------------------------- */
|
|
@@ -883,16 +988,51 @@ WraptObjectProxy_inplace_remainder(WraptObjectProxyObject *self,
|
|
|
883
988
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
884
989
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
885
990
|
|
|
886
|
-
|
|
991
|
+
if (PyObject_HasAttrString(self->wrapped, "__imod__"))
|
|
992
|
+
{
|
|
993
|
+
object = PyNumber_InPlaceRemainder(self->wrapped, other);
|
|
887
994
|
|
|
888
|
-
|
|
889
|
-
|
|
995
|
+
if (!object)
|
|
996
|
+
return NULL;
|
|
890
997
|
|
|
891
|
-
|
|
892
|
-
|
|
998
|
+
Py_DECREF(self->wrapped);
|
|
999
|
+
self->wrapped = object;
|
|
893
1000
|
|
|
894
|
-
|
|
895
|
-
|
|
1001
|
+
Py_INCREF(self);
|
|
1002
|
+
return (PyObject *)self;
|
|
1003
|
+
}
|
|
1004
|
+
else
|
|
1005
|
+
{
|
|
1006
|
+
PyObject *result = PyNumber_Remainder(self->wrapped, other);
|
|
1007
|
+
|
|
1008
|
+
if (!result)
|
|
1009
|
+
return NULL;
|
|
1010
|
+
|
|
1011
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1012
|
+
|
|
1013
|
+
if (!proxy_type)
|
|
1014
|
+
{
|
|
1015
|
+
Py_DECREF(proxy_type);
|
|
1016
|
+
return NULL;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1020
|
+
|
|
1021
|
+
Py_DECREF(result);
|
|
1022
|
+
|
|
1023
|
+
if (!proxy_args)
|
|
1024
|
+
{
|
|
1025
|
+
Py_DECREF(proxy_type);
|
|
1026
|
+
return NULL;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1030
|
+
|
|
1031
|
+
Py_DECREF(proxy_type);
|
|
1032
|
+
Py_DECREF(proxy_args);
|
|
1033
|
+
|
|
1034
|
+
return proxy_instance;
|
|
1035
|
+
}
|
|
896
1036
|
}
|
|
897
1037
|
|
|
898
1038
|
/* ------------------------------------------------------------------------- */
|
|
@@ -912,16 +1052,51 @@ static PyObject *WraptObjectProxy_inplace_power(WraptObjectProxyObject *self,
|
|
|
912
1052
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
913
1053
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
914
1054
|
|
|
915
|
-
|
|
1055
|
+
if (PyObject_HasAttrString(self->wrapped, "__ipow__"))
|
|
1056
|
+
{
|
|
1057
|
+
object = PyNumber_InPlacePower(self->wrapped, other, modulo);
|
|
916
1058
|
|
|
917
|
-
|
|
918
|
-
|
|
1059
|
+
if (!object)
|
|
1060
|
+
return NULL;
|
|
919
1061
|
|
|
920
|
-
|
|
921
|
-
|
|
1062
|
+
Py_DECREF(self->wrapped);
|
|
1063
|
+
self->wrapped = object;
|
|
922
1064
|
|
|
923
|
-
|
|
924
|
-
|
|
1065
|
+
Py_INCREF(self);
|
|
1066
|
+
return (PyObject *)self;
|
|
1067
|
+
}
|
|
1068
|
+
else
|
|
1069
|
+
{
|
|
1070
|
+
PyObject *result = PyNumber_Power(self->wrapped, other, modulo);
|
|
1071
|
+
|
|
1072
|
+
if (!result)
|
|
1073
|
+
return NULL;
|
|
1074
|
+
|
|
1075
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1076
|
+
|
|
1077
|
+
if (!proxy_type)
|
|
1078
|
+
{
|
|
1079
|
+
Py_DECREF(proxy_type);
|
|
1080
|
+
return NULL;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1084
|
+
|
|
1085
|
+
Py_DECREF(result);
|
|
1086
|
+
|
|
1087
|
+
if (!proxy_args)
|
|
1088
|
+
{
|
|
1089
|
+
Py_DECREF(proxy_type);
|
|
1090
|
+
return NULL;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1094
|
+
|
|
1095
|
+
Py_DECREF(proxy_type);
|
|
1096
|
+
Py_DECREF(proxy_args);
|
|
1097
|
+
|
|
1098
|
+
return proxy_instance;
|
|
1099
|
+
}
|
|
925
1100
|
}
|
|
926
1101
|
|
|
927
1102
|
/* ------------------------------------------------------------------------- */
|
|
@@ -940,16 +1115,51 @@ static PyObject *WraptObjectProxy_inplace_lshift(WraptObjectProxyObject *self,
|
|
|
940
1115
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
941
1116
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
942
1117
|
|
|
943
|
-
|
|
1118
|
+
if (PyObject_HasAttrString(self->wrapped, "__ilshift__"))
|
|
1119
|
+
{
|
|
1120
|
+
object = PyNumber_InPlaceLshift(self->wrapped, other);
|
|
944
1121
|
|
|
945
|
-
|
|
946
|
-
|
|
1122
|
+
if (!object)
|
|
1123
|
+
return NULL;
|
|
947
1124
|
|
|
948
|
-
|
|
949
|
-
|
|
1125
|
+
Py_DECREF(self->wrapped);
|
|
1126
|
+
self->wrapped = object;
|
|
950
1127
|
|
|
951
|
-
|
|
952
|
-
|
|
1128
|
+
Py_INCREF(self);
|
|
1129
|
+
return (PyObject *)self;
|
|
1130
|
+
}
|
|
1131
|
+
else
|
|
1132
|
+
{
|
|
1133
|
+
PyObject *result = PyNumber_Lshift(self->wrapped, other);
|
|
1134
|
+
|
|
1135
|
+
if (!result)
|
|
1136
|
+
return NULL;
|
|
1137
|
+
|
|
1138
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1139
|
+
|
|
1140
|
+
if (!proxy_type)
|
|
1141
|
+
{
|
|
1142
|
+
Py_DECREF(proxy_type);
|
|
1143
|
+
return NULL;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1147
|
+
|
|
1148
|
+
Py_DECREF(result);
|
|
1149
|
+
|
|
1150
|
+
if (!proxy_args)
|
|
1151
|
+
{
|
|
1152
|
+
Py_DECREF(proxy_type);
|
|
1153
|
+
return NULL;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1157
|
+
|
|
1158
|
+
Py_DECREF(proxy_type);
|
|
1159
|
+
Py_DECREF(proxy_args);
|
|
1160
|
+
|
|
1161
|
+
return proxy_instance;
|
|
1162
|
+
}
|
|
953
1163
|
}
|
|
954
1164
|
|
|
955
1165
|
/* ------------------------------------------------------------------------- */
|
|
@@ -968,16 +1178,51 @@ static PyObject *WraptObjectProxy_inplace_rshift(WraptObjectProxyObject *self,
|
|
|
968
1178
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
969
1179
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
970
1180
|
|
|
971
|
-
|
|
1181
|
+
if (PyObject_HasAttrString(self->wrapped, "__irshift__"))
|
|
1182
|
+
{
|
|
1183
|
+
object = PyNumber_InPlaceRshift(self->wrapped, other);
|
|
972
1184
|
|
|
973
|
-
|
|
974
|
-
|
|
1185
|
+
if (!object)
|
|
1186
|
+
return NULL;
|
|
975
1187
|
|
|
976
|
-
|
|
977
|
-
|
|
1188
|
+
Py_DECREF(self->wrapped);
|
|
1189
|
+
self->wrapped = object;
|
|
978
1190
|
|
|
979
|
-
|
|
980
|
-
|
|
1191
|
+
Py_INCREF(self);
|
|
1192
|
+
return (PyObject *)self;
|
|
1193
|
+
}
|
|
1194
|
+
else
|
|
1195
|
+
{
|
|
1196
|
+
PyObject *result = PyNumber_Rshift(self->wrapped, other);
|
|
1197
|
+
|
|
1198
|
+
if (!result)
|
|
1199
|
+
return NULL;
|
|
1200
|
+
|
|
1201
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1202
|
+
|
|
1203
|
+
if (!proxy_type)
|
|
1204
|
+
{
|
|
1205
|
+
Py_DECREF(proxy_type);
|
|
1206
|
+
return NULL;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1210
|
+
|
|
1211
|
+
Py_DECREF(result);
|
|
1212
|
+
|
|
1213
|
+
if (!proxy_args)
|
|
1214
|
+
{
|
|
1215
|
+
Py_DECREF(proxy_type);
|
|
1216
|
+
return NULL;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1220
|
+
|
|
1221
|
+
Py_DECREF(proxy_type);
|
|
1222
|
+
Py_DECREF(proxy_args);
|
|
1223
|
+
|
|
1224
|
+
return proxy_instance;
|
|
1225
|
+
}
|
|
981
1226
|
}
|
|
982
1227
|
|
|
983
1228
|
/* ------------------------------------------------------------------------- */
|
|
@@ -996,16 +1241,51 @@ static PyObject *WraptObjectProxy_inplace_and(WraptObjectProxyObject *self,
|
|
|
996
1241
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
997
1242
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
998
1243
|
|
|
999
|
-
|
|
1244
|
+
if (PyObject_HasAttrString(self->wrapped, "__iand__"))
|
|
1245
|
+
{
|
|
1246
|
+
object = PyNumber_InPlaceAnd(self->wrapped, other);
|
|
1247
|
+
|
|
1248
|
+
if (!object)
|
|
1249
|
+
return NULL;
|
|
1000
1250
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1251
|
+
Py_DECREF(self->wrapped);
|
|
1252
|
+
self->wrapped = object;
|
|
1253
|
+
|
|
1254
|
+
Py_INCREF(self);
|
|
1255
|
+
return (PyObject *)self;
|
|
1256
|
+
}
|
|
1257
|
+
else
|
|
1258
|
+
{
|
|
1259
|
+
PyObject *result = PyNumber_And(self->wrapped, other);
|
|
1003
1260
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1261
|
+
if (!result)
|
|
1262
|
+
return NULL;
|
|
1006
1263
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1264
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1265
|
+
|
|
1266
|
+
if (!proxy_type)
|
|
1267
|
+
{
|
|
1268
|
+
Py_DECREF(proxy_type);
|
|
1269
|
+
return NULL;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1273
|
+
|
|
1274
|
+
Py_DECREF(result);
|
|
1275
|
+
|
|
1276
|
+
if (!proxy_args)
|
|
1277
|
+
{
|
|
1278
|
+
Py_DECREF(proxy_type);
|
|
1279
|
+
return NULL;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1283
|
+
|
|
1284
|
+
Py_DECREF(proxy_type);
|
|
1285
|
+
Py_DECREF(proxy_args);
|
|
1286
|
+
|
|
1287
|
+
return proxy_instance;
|
|
1288
|
+
}
|
|
1009
1289
|
}
|
|
1010
1290
|
|
|
1011
1291
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1024,16 +1304,51 @@ static PyObject *WraptObjectProxy_inplace_xor(WraptObjectProxyObject *self,
|
|
|
1024
1304
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
1025
1305
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
1026
1306
|
|
|
1027
|
-
|
|
1307
|
+
if (PyObject_HasAttrString(self->wrapped, "__ixor__"))
|
|
1308
|
+
{
|
|
1309
|
+
object = PyNumber_InPlaceXor(self->wrapped, other);
|
|
1028
1310
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1311
|
+
if (!object)
|
|
1312
|
+
return NULL;
|
|
1031
1313
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1314
|
+
Py_DECREF(self->wrapped);
|
|
1315
|
+
self->wrapped = object;
|
|
1034
1316
|
|
|
1035
|
-
|
|
1036
|
-
|
|
1317
|
+
Py_INCREF(self);
|
|
1318
|
+
return (PyObject *)self;
|
|
1319
|
+
}
|
|
1320
|
+
else
|
|
1321
|
+
{
|
|
1322
|
+
PyObject *result = PyNumber_Xor(self->wrapped, other);
|
|
1323
|
+
|
|
1324
|
+
if (!result)
|
|
1325
|
+
return NULL;
|
|
1326
|
+
|
|
1327
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1328
|
+
|
|
1329
|
+
if (!proxy_type)
|
|
1330
|
+
{
|
|
1331
|
+
Py_DECREF(proxy_type);
|
|
1332
|
+
return NULL;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1336
|
+
|
|
1337
|
+
Py_DECREF(result);
|
|
1338
|
+
|
|
1339
|
+
if (!proxy_args)
|
|
1340
|
+
{
|
|
1341
|
+
Py_DECREF(proxy_type);
|
|
1342
|
+
return NULL;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1346
|
+
|
|
1347
|
+
Py_DECREF(proxy_type);
|
|
1348
|
+
Py_DECREF(proxy_args);
|
|
1349
|
+
|
|
1350
|
+
return proxy_instance;
|
|
1351
|
+
}
|
|
1037
1352
|
}
|
|
1038
1353
|
|
|
1039
1354
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1052,16 +1367,51 @@ static PyObject *WraptObjectProxy_inplace_or(WraptObjectProxyObject *self,
|
|
|
1052
1367
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
1053
1368
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
1054
1369
|
|
|
1055
|
-
|
|
1370
|
+
if (PyObject_HasAttrString(self->wrapped, "__ior__"))
|
|
1371
|
+
{
|
|
1372
|
+
object = PyNumber_InPlaceOr(self->wrapped, other);
|
|
1056
1373
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1374
|
+
if (!object)
|
|
1375
|
+
return NULL;
|
|
1059
1376
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1377
|
+
Py_DECREF(self->wrapped);
|
|
1378
|
+
self->wrapped = object;
|
|
1062
1379
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1380
|
+
Py_INCREF(self);
|
|
1381
|
+
return (PyObject *)self;
|
|
1382
|
+
}
|
|
1383
|
+
else
|
|
1384
|
+
{
|
|
1385
|
+
PyObject *result = PyNumber_Or(self->wrapped, other);
|
|
1386
|
+
|
|
1387
|
+
if (!result)
|
|
1388
|
+
return NULL;
|
|
1389
|
+
|
|
1390
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1391
|
+
|
|
1392
|
+
if (!proxy_type)
|
|
1393
|
+
{
|
|
1394
|
+
Py_DECREF(proxy_type);
|
|
1395
|
+
return NULL;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1399
|
+
|
|
1400
|
+
Py_DECREF(result);
|
|
1401
|
+
|
|
1402
|
+
if (!proxy_args)
|
|
1403
|
+
{
|
|
1404
|
+
Py_DECREF(proxy_type);
|
|
1405
|
+
return NULL;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1409
|
+
|
|
1410
|
+
Py_DECREF(proxy_type);
|
|
1411
|
+
Py_DECREF(proxy_args);
|
|
1412
|
+
|
|
1413
|
+
return proxy_instance;
|
|
1414
|
+
}
|
|
1065
1415
|
}
|
|
1066
1416
|
|
|
1067
1417
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1139,16 +1489,51 @@ WraptObjectProxy_inplace_floor_divide(WraptObjectProxyObject *self,
|
|
|
1139
1489
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
1140
1490
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
1141
1491
|
|
|
1142
|
-
|
|
1492
|
+
if (PyObject_HasAttrString(self->wrapped, "__ifloordiv__"))
|
|
1493
|
+
{
|
|
1494
|
+
object = PyNumber_InPlaceFloorDivide(self->wrapped, other);
|
|
1143
1495
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1496
|
+
if (!object)
|
|
1497
|
+
return NULL;
|
|
1146
1498
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1499
|
+
Py_DECREF(self->wrapped);
|
|
1500
|
+
self->wrapped = object;
|
|
1149
1501
|
|
|
1150
|
-
|
|
1151
|
-
|
|
1502
|
+
Py_INCREF(self);
|
|
1503
|
+
return (PyObject *)self;
|
|
1504
|
+
}
|
|
1505
|
+
else
|
|
1506
|
+
{
|
|
1507
|
+
PyObject *result = PyNumber_FloorDivide(self->wrapped, other);
|
|
1508
|
+
|
|
1509
|
+
if (!result)
|
|
1510
|
+
return NULL;
|
|
1511
|
+
|
|
1512
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1513
|
+
|
|
1514
|
+
if (!proxy_type)
|
|
1515
|
+
{
|
|
1516
|
+
Py_DECREF(proxy_type);
|
|
1517
|
+
return NULL;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1521
|
+
|
|
1522
|
+
Py_DECREF(result);
|
|
1523
|
+
|
|
1524
|
+
if (!proxy_args)
|
|
1525
|
+
{
|
|
1526
|
+
Py_DECREF(proxy_type);
|
|
1527
|
+
return NULL;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1531
|
+
|
|
1532
|
+
Py_DECREF(proxy_type);
|
|
1533
|
+
Py_DECREF(proxy_args);
|
|
1534
|
+
|
|
1535
|
+
return proxy_instance;
|
|
1536
|
+
}
|
|
1152
1537
|
}
|
|
1153
1538
|
|
|
1154
1539
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1168,16 +1553,51 @@ WraptObjectProxy_inplace_true_divide(WraptObjectProxyObject *self,
|
|
|
1168
1553
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
1169
1554
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
1170
1555
|
|
|
1171
|
-
|
|
1556
|
+
if (PyObject_HasAttrString(self->wrapped, "__itruediv__"))
|
|
1557
|
+
{
|
|
1558
|
+
object = PyNumber_InPlaceTrueDivide(self->wrapped, other);
|
|
1172
1559
|
|
|
1173
|
-
|
|
1174
|
-
|
|
1560
|
+
if (!object)
|
|
1561
|
+
return NULL;
|
|
1175
1562
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1563
|
+
Py_DECREF(self->wrapped);
|
|
1564
|
+
self->wrapped = object;
|
|
1178
1565
|
|
|
1179
|
-
|
|
1180
|
-
|
|
1566
|
+
Py_INCREF(self);
|
|
1567
|
+
return (PyObject *)self;
|
|
1568
|
+
}
|
|
1569
|
+
else
|
|
1570
|
+
{
|
|
1571
|
+
PyObject *result = PyNumber_TrueDivide(self->wrapped, other);
|
|
1572
|
+
|
|
1573
|
+
if (!result)
|
|
1574
|
+
return NULL;
|
|
1575
|
+
|
|
1576
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1577
|
+
|
|
1578
|
+
if (!proxy_type)
|
|
1579
|
+
{
|
|
1580
|
+
Py_DECREF(proxy_type);
|
|
1581
|
+
return NULL;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1585
|
+
|
|
1586
|
+
Py_DECREF(result);
|
|
1587
|
+
|
|
1588
|
+
if (!proxy_args)
|
|
1589
|
+
{
|
|
1590
|
+
Py_DECREF(proxy_type);
|
|
1591
|
+
return NULL;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1595
|
+
|
|
1596
|
+
Py_DECREF(proxy_type);
|
|
1597
|
+
Py_DECREF(proxy_args);
|
|
1598
|
+
|
|
1599
|
+
return proxy_instance;
|
|
1600
|
+
}
|
|
1181
1601
|
}
|
|
1182
1602
|
|
|
1183
1603
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1238,16 +1658,51 @@ static PyObject *WraptObjectProxy_inplace_matrix_multiply(
|
|
|
1238
1658
|
if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
|
|
1239
1659
|
other = ((WraptObjectProxyObject *)other)->wrapped;
|
|
1240
1660
|
|
|
1241
|
-
|
|
1661
|
+
if (PyObject_HasAttrString(self->wrapped, "__imatmul__"))
|
|
1662
|
+
{
|
|
1663
|
+
object = PyNumber_InPlaceMatrixMultiply(self->wrapped, other);
|
|
1242
1664
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1665
|
+
if (!object)
|
|
1666
|
+
return NULL;
|
|
1245
1667
|
|
|
1246
|
-
|
|
1247
|
-
|
|
1668
|
+
Py_DECREF(self->wrapped);
|
|
1669
|
+
self->wrapped = object;
|
|
1248
1670
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1671
|
+
Py_INCREF(self);
|
|
1672
|
+
return (PyObject *)self;
|
|
1673
|
+
}
|
|
1674
|
+
else
|
|
1675
|
+
{
|
|
1676
|
+
PyObject *result = PyNumber_MatrixMultiply(self->wrapped, other);
|
|
1677
|
+
|
|
1678
|
+
if (!result)
|
|
1679
|
+
return NULL;
|
|
1680
|
+
|
|
1681
|
+
PyObject *proxy_type = PyObject_GetAttrString((PyObject *)self, "__object_proxy__");
|
|
1682
|
+
|
|
1683
|
+
if (!proxy_type)
|
|
1684
|
+
{
|
|
1685
|
+
Py_DECREF(proxy_type);
|
|
1686
|
+
return NULL;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
PyObject *proxy_args = PyTuple_Pack(1, result);
|
|
1690
|
+
|
|
1691
|
+
Py_DECREF(result);
|
|
1692
|
+
|
|
1693
|
+
if (!proxy_args)
|
|
1694
|
+
{
|
|
1695
|
+
Py_DECREF(proxy_type);
|
|
1696
|
+
return NULL;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
PyObject *proxy_instance = PyObject_Call(proxy_type, proxy_args, NULL);
|
|
1700
|
+
|
|
1701
|
+
Py_DECREF(proxy_type);
|
|
1702
|
+
Py_DECREF(proxy_args);
|
|
1703
|
+
|
|
1704
|
+
return proxy_instance;
|
|
1705
|
+
}
|
|
1251
1706
|
}
|
|
1252
1707
|
|
|
1253
1708
|
/* ------------------------------------------------------------------------- */
|
|
@@ -1834,6 +2289,14 @@ static PyObject *WraptObjectProxy_get_wrapped(WraptObjectProxyObject *self)
|
|
|
1834
2289
|
|
|
1835
2290
|
/* ------------------------------------------------------------------------- */
|
|
1836
2291
|
|
|
2292
|
+
static PyObject *WraptObjectProxy_get_object_proxy(WraptObjectProxyObject *self)
|
|
2293
|
+
{
|
|
2294
|
+
Py_INCREF(&WraptObjectProxy_Type);
|
|
2295
|
+
return (PyObject *)&WraptObjectProxy_Type;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/* ------------------------------------------------------------------------- */
|
|
2299
|
+
|
|
1837
2300
|
static int WraptObjectProxy_set_wrapped(WraptObjectProxyObject *self,
|
|
1838
2301
|
PyObject *value)
|
|
1839
2302
|
{
|
|
@@ -2109,6 +2572,7 @@ static PyGetSetDef WraptObjectProxy_getset[] = {
|
|
|
2109
2572
|
(setter)WraptObjectProxy_set_annotations, 0},
|
|
2110
2573
|
{"__wrapped__", (getter)WraptObjectProxy_get_wrapped,
|
|
2111
2574
|
(setter)WraptObjectProxy_set_wrapped, 0},
|
|
2575
|
+
{"__object_proxy__", (getter)WraptObjectProxy_get_object_proxy, 0, 0},
|
|
2112
2576
|
{NULL},
|
|
2113
2577
|
};
|
|
2114
2578
|
|