from forbiddenfruit import curse, reverse
def bob(self,ted):#{
return self[0] + ted[0];
#}
curse(type([1,2,3]),"__add__",bob)
v1=[2,3,4];
v2=[5,2,3];
print(v1 + v2)
print(v1.__add__(v2))
In the above code, I expect both instances of print to generate the same results, and they do if I remove the curse function (both uncursed). As is, only the first instance (v1 + v2) is properly cursed, where's the second instance continues to function according to its uncursed state despite being the actual text that was used in the cursing process.
Testing primarily on Python 3.11.5, but also did a quick test on 3.12 with a variable other than list.
In the above code, I expect both instances of print to generate the same results, and they do if I remove the curse function (both uncursed). As is, only the first instance (
v1 + v2) is properly cursed, where's the second instance continues to function according to its uncursed state despite being the actual text that was used in the cursing process.Testing primarily on Python 3.11.5, but also did a quick test on 3.12 with a variable other than list.