Closed beauxq closed 3 months ago
From what I've seen it's pretty much impossible for most libraries to support Pyright in strict mode, therefore it's not a goal. We pass MyPy in strict mode and Pyright in basic mode. That said, we're always open to PRs that improve the typing in a clear and maintainable way.
dict[]
is not valid at runtime until Python 3.9. We support Python 3.8 at minimum right now, until it goes EOL. So we'll be able to fix this in a few months, and will automatically know to do so when we run pyupgrade or bump the version checked by the tools.
class Config(t.Dict[str, t.Any]):
would work in Python 3.8
I don't think it's worth the churn if it will be changed again the release after.
The
# type: ignore
in the code here https://github.com/pallets/flask/blob/8a6cdf1e2a5efa81c30f6166602064ceefb0a35b/src/flask/config.py#L50 is causing type errors to be reported in user code with pyright strict settings.Based on other typing in the same class, it looks like it could be:
Environment: