Minimal reproducible example:
import openpyxl
from openpyxl.worksheet._read_only import ReadOnlyWorksheet
wb = openpyxl.load_workbook('...', read_only = True)
ws: ReadOnlyWorksheet = wb['foo']
ws[0]
# mypy => error:
# Invalid self argument "ReadOnlyWorksheet" to attribute function "__getitem__"
# with type "Callable[[Worksheet, int], tuple[Cell, ...]]"
The culprit is this assignment:
class ReadOnlyWorksheet:
...
__getitem__ = Worksheet.__getitem__
(From this Stack Overflow question.)