次のようなコードがあります。
class C(str):
def __init__(self, a, b):
print('init was called!')
super().__init__(b)
self.a = a
c = C(12, 'c')
実行しようとすると、次のエラーが表示されます。
Traceback (most recent call last):
File "C:\Users\math4tots\eclipseMeta\hemi\SalgebraPL\sapl.py", line 15, in <module>
c = C(12, 'c')
TypeError: coercing to str: need bytes, bytearray or buffer-like object, int found
私はかなり混乱しています。私のinitメソッドが呼び出されたようにも見えません。どうしたの?
関連性があるかどうかはわかりませんが、Python 3.2 を使用しています