Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Imports in python are not solved correctly #2060

Closed
konradweiss opened this issue Feb 20, 2025 · 0 comments · Fixed by #2062
Closed

Imports in python are not solved correctly #2060

konradweiss opened this issue Feb 20, 2025 · 0 comments · Fixed by #2062
Assignees

Comments

@konradweiss
Copy link
Collaborator

In python when writing import json.encode, not only json.encode but also functions in json are reachable. This is not correctly implemented currently and the following code has unresolved references:

import json.encoder

a=json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
b=json.encoder.JSONEncoder().item_separator
c=str(1)

Here https://docs.python.org/3/reference/simple_stmts.html#the-import-statement the example shows how imports of nexted modules leads to their parent modules being imported as well, only what is bound in the local namespace is more restricted.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants