How django-stubs-ext monkeypatching works
masterThe django-stubs-ext package detects your installed Django version at runtime and applies only the necessary patches. The primary patch adds a __class_getitem__ method to generic Django classes to support type hinting syntax. This method is a no-op and is safe to use in production:
@classmethod
def __class_getitem__(cls, *args, **kwargs):
return cls