mypy
mypy copied to clipboard
code-blockwise configuration settings
Feature
In mypy, we can do something like # type: ignore [error-code]
For some developer tools, we can use some blockwise settings, ex:
# fmt: off
blabla
# fmt: on
Momentarily configuring some mypy settings in a similar fashion would be useful
Pitch
A specific reason why I'd like to see this is that I have a codebase where allow-redefinition is False (and this is good). But I have a small region where I have a lot of type narrowing to do and in this case allowing a block of redefinitions is far more convenient. Plus, the control comments would signal to the reader that this is happening.