~/dev/cpython (main)⚡ % PYTHON_BASIC_REPL=1 ./python.exe -i foo.py
>>> Foo
<class '__main__.Foo'>
~/dev/cpython (main)⚡ % ./python.exe -i foo.py
>>> Foo
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
Foo
NameError: name 'Foo' is not defined
>>>
Bug report
Bug description:
If I have a module called
foo.py with the following contents in the root of my CPython local clone:Then running
PYTHON_BASIC_REPL=1 ./python.exe -i foo.py, I get the following behaviour:foo.pyis executed, and theFooclass is available in the globals of the REPL:But with the new REPL, the
Fooclass isn't available!~/dev/cpython (main)⚡ % ./python.exe -i foo.py >>> Foo Traceback (most recent call last): File "<python-input-0>", line 1, in <module> Foo NameError: name 'Foo' is not defined >>>CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
-i#120904-i(GH-120904) #121916