I was wondering if anyone has had any luck implementing the special method __pow__? I tried searching for others implementation and tried adding c extension code for the objxxx.c files but when trying to override the object in the class initiator I get the following:
Code: Select all
> import CustomList
> a = CustomList(1,2,3)
> a**2
>Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported types for <listcomp>: 'CustomList', 'int'