Код: Выделить всё
In [4]: In [17]: class X:
...: def not_shadow(self, x: list[int]):
...: pass
...:
...: def list(self):
...: list()
...:
...: def shadow_by_X_list_method(self, x: list[int]):
...: pass
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 class X:
2 def not_shadow(self, x: list[int]):
3 pass
Cell In[4], line 8, in X()
5 def list(self):
6 list()
----> 8 def shadow_by_X_list_method(self, x: list[int]):
9 pass
TypeError: 'function' object is not subscriptable
Подробнее здесь: https://stackoverflow.com/questions/790 ... method-typ