I want to inherit from the array.array class, and here's my code.
import array
a = array.array('d', [1.0, 2.0, 3.14])
import numpy as np
class diff_rle_array(array.array):
def __init__(self, arr: array):
self._internal = np.ediff1d(arr)
diff_rle_array(a)
But it gives an error
>>> diff_rle_array(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: array() argument 1 must be a unicode character, not array.array
But I have overridden the __init__ method. Is it because array.array is in the base library and hence special?