| 163 | """ |
| 164 | |
| 165 | def __init_subclass__(cls, **kwargs: t.Any) -> None: |
| 166 | super().__init_subclass__(**kwargs) |
| 167 | |
| 168 | if "methods" not in cls.__dict__: |
| 169 | methods = set() |
| 170 | |
| 171 | for base in cls.__bases__: |
| 172 | if getattr(base, "methods", None): |
| 173 | methods.update(base.methods) # type: ignore[attr-defined] |
| 174 | |
| 175 | for key in http_method_funcs: |
| 176 | if hasattr(cls, key): |
| 177 | methods.add(key.upper()) |
| 178 | |
| 179 | if methods: |
| 180 | cls.methods = methods |
| 181 | |
| 182 | def dispatch_request(self, **kwargs: t.Any) -> ft.ResponseReturnValue: |
| 183 | meth = getattr(self, request.method.lower(), None) |