FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-142349: Fix ast.unparse for lazy import statements by pablogsal · Pull Request #144893 · python/cpython · GitHub

Repository navigation

gh-142349: Fix ast.unparse for lazy import statements - #144893

Merged
pablogsal merged 1 commit into
python:mainfrom
pablogsal:unparse-lazy
Feb 16, 2026
Merged

pablogsal merged 1 commit into
python:mainfrom
pablogsal:unparse-lazy

Conversation

pablogsal commented Feb 16, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

The unparser was not handling the is_lazy attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing lazy import statements.

The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.

itamaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should this be covered by additional unittests?

Copy link
Copy Markdown
Member Author

Should this be covered by additional unittests?

For now I am landing this to stop the inevitable failure in all the buildbots that build with -uall we can then add unittest later

pablogsal merged commit 18c04f2 into python:main Feb 16, 2026
53 checks passed
pablogsal deleted the unparse-lazy branch February 16, 2026 22:57
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
…44893)

The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…44893)

The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL