You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to json: Any = json_1.loads(value) we must alias import json or we get:
Traceback (most recent call last):
File "C:\Users\Kevin\source\repos\Fable\src\quicktest-py\quicktest.py", line 83, in<module>
main(sys.argv[1:])
File "C:\Users\Kevin\source\repos\Fable\src\quicktest-py\quicktest.py", line 73, in main
result: FSharpResult_2[dict[str, Any], str] = Decode_fromString(decoder, content)
File "C:\Users\Kevin\source\repos\Fable\src\quicktest-py\fable_modules\thoth_json_python\decode.py", line 99, in Decode_fromString
raise match_value_1
File "C:\Users\Kevin\source\repos\Fable\src\quicktest-py\fable_modules\thoth_json_python\decode.py", line 79, in Decode_fromString
json: Any = json.loads(value)
UnboundLocalError: local variable 'json' referenced before assignment
If we go one version higher fable-5.0.0-alpha.10 we only get import json without alias.
The text was updated successfully, but these errors were encountered:
Freymaurer
changed the title
Python Fable-alpha.10 does not alias imports introducing "Reassignment" errors
Python 5.0.0-alpha.10 does not alias imports introducing "Reassignment" errors
Mar 25, 2025
[<Fact>]
let ``test importAll`` () =
let nativeCode: NativeCode = importAll "./native_code.py"
3 |> nativeCode.add5 |> equal 8
Which works as expected. I am not sure if the test with raw python based on a fable import should work. I will open a PR, feel free to tell me otherwise.
Using
Thoth.Json.Python
in Fable 5.0.0-alpha.9 we get inthoth_json_python/encode.py
the following:Due to
json: Any = json_1.loads(value)
we must aliasimport json
or we get:If we go one version higher
fable-5.0.0-alpha.10
we only getimport json
without alias.The text was updated successfully, but these errors were encountered: