Author serhiy.storchaka
Recipients barry, brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, xiang.zhang
Date 2018-02-26.09:44:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I was fooled by similarity of Python and C code, but actually Python and C code are not different implementations of the same algorithm, they have different purposes. The purpose of _bootstrap._handle_fromlist() is importing requested submodules first than `from pkg import submod1, submod2` change the outer locals/globals namespace. In the case of the star import it imports submodules enumerated in the package's __all__. The purpose of the IMPORT_STAR opcode is updating the globals namespace by the content of already imported module/package. Both codes iterate __all__ and use its items. The additional check in Python code was needed to prevent a BytesWarning. The additional check in IMPORT_STAR proposed in this issue is not strongly required. The exception of the correct type is already raised, and its message is not incorrect. But it can be improved to help fixing an obscure user error.

I'm not very happy that we adds so much C code in ceval.c for handling a subtle error,  but seems there is no other way (except keeping all as it is).
Date User Action Args
2018-02-26 09:44:07serhiy.storchakasetrecipients: + serhiy.storchaka, barry, brett.cannon, ncoghlan, eric.snow, xiang.zhang
2018-02-26 09:44:07serhiy.storchakasetmessageid: <>
2018-02-26 09:44:07serhiy.storchakalinkissue32932 messages
2018-02-26 09:44:07serhiy.storchakacreate