How to avoid this VSCode + Pylance static type check error?
def process_row(row: dict[str, Any]):
row = SimpleNamespace(**row)
For this, vscode shows red underline for SimpleNamespace(**row) with messsage: Expression of type "SimpleNamespace" cannot be assigned to declared type "dict[str, Any]"
After more searching and going through
githubissues forpylanceandmypy, it appears that this is legitimate open issue forpylance.mypykind of fixed this. For above function, runningmypy typetest.pygave 1 error:Name "row" already defined on line 5but rnunning withmypy --allow-redefinition typetest.pywas all green.You can not yet turn of this in
pylanceit seems but let people know here if anyone point this out. Thanks.