Brett Cannon <br...@python.org> added the comment:

Sorry, I'm having a hard time following what you've written and I unfortunately 
don't have time to examine your (I assume) .tar.xz file. When you say 
"directory-based-module", do you mean a package (e.g. `__init__.py` in a 
directory)? It's important to be clear because not all imports come from a file 
system, and so a package versus a module has important distinctions.

Could you write out what you're seeing and what you're expecting? E.g.
```
# pkg/__init__.py
from pkg.submodule import *  # Expecting `submodule_attr`, getting ...
```

```
# pkg/submodule.py
submodule_attr = 0
```

I will also say you really shouldn't be using `import *`. It primarily exists 
to make it easier to work in the REPL, and otherwise is rather archaic and has 
very odd import semantics.

As for how Python 2 did things, that (luckly) doesn't matter anymore. :) To 
show that this is a change in semantics you would need to check Python 3 
versions to see where it shifted. If this changed in 3.9 then turning it back 
may work. But if it's more like 3.4 then I'm afraid these are now the semantics 
and the risk of code breakage is possibly too high.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43477>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to