You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing __hello__ or __phello__ on Python 3.7-3.10 prints "Hello world!"
Importing __hello__ or __phello__ on Python 3.11-3.12 prints nothing.
$ python3.7
Python 3.7.13 (default, Jul 8 2022, 20:05:46)
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
Hello world!
>>> import __phello__
Hello world!
>>>
$ python3.8
Python 3.8.13 (default, Apr 26 2022, 16:12:31)
[Clang 13.1.6 (clang-1316.0.21.2.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
Hello world!
>>> import __phello__
Hello world!
>>>
$ python3.9
Python 3.9.13 (main, May 24 2022, 21:13:51)
[Clang 13.1.6 (clang-1316.0.21.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
Hello world!
>>> import __phello__
Hello world!
>>>
$ python3.10
Python 3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
Hello world!
>>> import __phello__
Hello world!
>>>
$ python3.11
Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
>>> import __phello__
>>> ^D
$ python3.12
Python 3.12.0a3 (v3.12.0a3:b6bd7ffcbc, Dec 6 2022, 15:26:51) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __hello__
>>> import __phello__
>>> ^D
And at least as early as 3.11.0a2:
$ ./python.exe
Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4bab9, Dec 9 2022, 16:19:07) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import __phello__
>>> import __hello__
>>>
The behavior was intentionally changed by issue #89182 and pull request #28374. __hello__ and __phello__.spam still print to sys.stdout when run as scripts. When imported, main() has to be called. For example:
Bug report
Importing
__hello__
or__phello__
on Python 3.7-3.10 prints "Hello world!"Importing
__hello__
or__phello__
on Python 3.11-3.12 prints nothing.And at least as early as 3.11.0a2:
(I couldn't build 3.11.0a1)
Your environment
The text was updated successfully, but these errors were encountered: