Can I have a package and a module with the same name in Python?
ex:
import json
import myapp.json.jsoncustommodule
I don’t know if this has anything to do with the fact that json is in Python built-in library.
In most languages, this is acceptable. However, Python seems to confuse both things, even if they are in different parent packages.
To answer your question, there’s no issue with doing something like this in python.
However if you have a namespace conflict resulting from something like this:-
You will need to resolve it by using
askeyword, like this:-