Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

New REPL does not include globals from executed module when used with-i #120678

Closed
Assignees
AlexWaygood
Labels
3.13bugs and security fixes3.14bugs and security fixestopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@AlexWaygood

Description

@AlexWaygood

Bug report

Bug description:

If I have a module calledfoo.py with the following contents in the root of my CPython local clone:

classFoo:pass

Then runningPYTHON_BASIC_REPL=1 ./python.exe -i foo.py, I get the following behaviour:foo.py is executed, and theFoo class is available in the globals of the REPL:

~/dev/cpython (main)⚡ % PYTHON_BASIC_REPL=1 ./python.exe -i foo.py >>> Foo<class '__main__.Foo'>

But with the new REPL, theFoo class isn't available!

~/dev/cpython (main)⚡ % ./python.exe -i foo.py >>> FooTraceback (most recent call last):  File "<python-input-0>", line 1, in <module>    FooNameError: name 'Foo' is not defined>>>

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixestopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp