In ctypes documentation there is an example showcasing code on how to create arrays where an object of type class is multiplied by an int.
>>> from ctypes import *
>>> TenIntegers = c_int * 10
>>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
>>> print(ii)
<c_long_Array_10 object at 0x...>
In python3 shell, I have checked and confirmed that ctypes.c_int is type class.
>>> type(ctypes.c_int)
<class '_ctypes.PyCSimpleType'>
I know that classes can define how operators behave with their class instances via dunder methods, but I have never seen definitions of behavior with the class objects themselves. I have tried checking the source code of ctypes, but I find it very difficult to understand it. Does anyone know how something like that could be implemented or how it is implemented?