[Python-Dev] Re: import * and __future__ imports

2022-03-28 Thread Guido van Rossum
On Mon, Mar 28, 2022 at 8:52 AM Irit Katriel wrote: > > > On Mon, Mar 28, 2022 at 4:44 PM Guido van Rossum wrote: > >> >> "Future" imports are special to the parser, and they may also set a flag >> for the runtime to alter its behavior, but they are intentionally not >> treated specially by code

[Python-Dev] Re: import * and __future__ imports

2022-03-28 Thread Irit Katriel via Python-Dev
On Mon, Mar 28, 2022 at 4:44 PM Guido van Rossum wrote: > > "Future" imports are special to the parser, and they may also set a flag > for the runtime to alter its behavior, but they are intentionally not > treated specially by code generation, so they are still properly imported. > However the p

[Python-Dev] Re: import * and __future__ imports

2022-03-28 Thread Guido van Rossum
On Mon, Mar 28, 2022 at 6:29 AM Irit Katriel via Python-Dev < python-dev@python.org> wrote: > If you have a __future__ import in a script, and you import * from it in > another script, the object for this future appears in the dir() of the > other script, even though the __future__ import has no e

[Python-Dev] Re: import * and __future__ imports

2022-03-28 Thread Petr Viktorin
On 28. 03. 22 15:25, Irit Katriel via Python-Dev wrote: If you have a __future__ import in a script, and you import * from it in another script, the object for this future appears in the dir() of the other script, even though the __future__ import has no effect there. % cat x.py from __future_