The following test case fails. Place the following code in mypy-test.py:
import logging
from typing import Any, MutableMapping, Tuple
class Adapter(logging.LoggerAdapter):
def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]:
data = self.extra['data']
return ('%s' % data), kwargs
Then I get
$ mypy mypy-test.py
mypy-test.py:5: error: "Adapter" has no attribute "extra"
This location should have extra: Mapping[str, Any] put right below it.