Typechecking dynamically added attributes
问题 When writing project-specific pytest plugins, I often find the Config object useful to attach my own properties. Example: from _pytest.config import Config def pytest_configure(config: Config) -> None: config.fizz = "buzz" def pytest_unconfigure(config: Config) -> None: print(config.fizz) Obviously, there's no fizz attribute in _pytest.config.Config class, so running mypy over the above snippet yields conftest.py:5: error: "Config" has no attribute "fizz" conftest.py:8: error: "Config" has no