-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 5.0.0-alpha.10 does not alias imports introducing "Reassignment" errors #4089
Comments
Can be reproduced by adding the following line to python quicktest: let json = Fable.Python.Json.json.loads @"{""name"":""Alice"",""age"":30}" |
My proposed fix clashed with one of the tests: [<Fact>]
let ``test importSideEffects`` () = // See #3965
importSideEffects "./native_code.py"
let mutable x = 3
Py.python $"""
{x} = native_code.add5({x} + 2)
"""
x |> equal 10 def test_import_side_effects(__unit: None=None) -> None:
x: int = 3
x = native_code.add5(x + 2)
Testing_equal(10, x) But because of my changes the import was aliased to: The referenced issue is in my opinion solved by the test below:
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: