This is my project structure:
a
├── b.py
└── __init__.py
File
b.pyis empty.File
__init__.pyis one line:b = 'this is a str'
Then the following program gives inconsistent result of a.b:
import a
print(a.b) # str
import a.b
print(a.b) # module
What is the best way of detecting this kind of name conflict between a variable and a filename?