type-alias

TypeError: 'numpy._DTypeMeta' object is not subscriptable

TypeError: 'numpy._DTypeMeta' object is not subscriptable Question: I’m trying to type hint a numpy ndarray like this: RGB = numpy.dtype[numpy.uint8] ThreeD = tuple[int, int, int] def load_images(paths: list[str]) -> tuple[list[numpy.ndarray[ThreeD, RGB]], list[str]]: … but at the first line when I run this, I got the following error: RGB = numpy.dtype[numpy.uint8] TypeError: ‘numpy._DTypeMeta’ object is not …

Total answers: 4