Using Python 3.9, mypy will complain about static_folder being Optional[str] and not accepting a pathlib.Path.
note: Revealed type is "pathlib.Path*" # This is what I'm feeding it
Revealed type is "Union[builtins.str, None]" # this is reveal_path() for app.static_folder
error: Incompatible types in assignment (expression has type "Path", variable has type "Optional[str]")
Found 1 error in 1 file (checked 1 source file)
Not sure why Python 3.8 doesn't do this.
I think maybe here: https://github.com/pallets/flask/blob/main/src/flask/scaffold.py#L80
I think this needs to be _static_folder: t.Union[t.Optional[str], Path] = None
Or maybe... _static_folder: t.Optional[t.Union[str, Path]] = None
And at the top: from pathlib import Path
Thank you!