GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-108113: Make it possible to create an optimized AST by iritkatriel · Pull Request #108154 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Aug 19, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #108113.

  • Issue: compile() with PyCF_ONLY_AST flag ignores the optimize arg #108113

📚 Documentation preview 📚: https://cpython-previews--108154.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
iritkatriel added 5 commits August 18, 2023 22:02
@iritkatriel
pythongh-108113: optimize ASTs in ast.parse/ast.literal_eval/compile(…
c491162
…..., flags=ast.PyCF_ONLY_AST)
@iritkatriel
add PyCF_OPTIMIZED_AST
65b1461
@iritkatriel
update docs
1273e4c
@iritkatriel
revert unnecessary change
ece282e
@iritkatriel
add tests
69d969d
@iritkatriel
iritkatriel requested a review from isidentical as a code owner August 19, 2023 21:54
@bedevere-bot bedevere-bot mentioned this pull request Aug 19, 2023
compile() with PyCF_ONLY_AST flag ignores the optimize arg #108113
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Aug 19, 2023
@iritkatriel
iritkatriel requested a review from carljm August 19, 2023 21:54
iritkatriel and others added 2 commits August 19, 2023 23:38
@iritkatriel
update Parser/asdl_c.py
3850521
@iritkatriel
Merge branch 'main' into ast_opt
fae6c71
corona10
corona10 reviewed Aug 20, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

corona10
corona10 reviewed Aug 20, 2023
View reviewed changes
Comment thread Lib/test/test_builtin.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel and others added 2 commits August 21, 2023 10:06
@iritkatriel
make patchcheck
b6d49a8
@iritkatriel @corona10
Update Doc/whatsnew/3.13.rst
1070d01
Co-authored-by: Dong-hee Na <[email protected]>
carljm
carljm reviewed Aug 21, 2023
View reviewed changes

@carljm carljm left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks like there's a docs build issue, but otherwise this LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel
Revert "Update Doc/whatsnew/3.13.rst"
d0eba59
This reverts commit 1070d01.
@iritkatriel
iritkatriel enabled auto-merge (squash) August 21, 2023 15:49
corona10
corona10 approved these changes Aug 21, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Aug 21, 2023
@iritkatriel
iritkatriel merged commit 10a91d7 into python:main Aug 21, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 21, 2023
@carljm carljm mentioned this pull request Dec 17, 2023
compile(optimize=2) doesn't del docstrings/asserts, ignores -OO & PYTHONOPTIMIZE=2 #112909
Closed
@dreamflow

dreamflow commented Dec 17, 2023

Copy link
Copy Markdown
Contributor

should the new ast.PyCF_OPTIMIZED_AST
be mentioned in the compiler-flags doc ?

the compile() doc has a link to the compiler-flags doc ,
so that someone reading the compile() doc , can find out
that compile() has the ast.PyCF_OPTIMIZED_AST option .

carljm reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel

iritkatriel commented Dec 17, 2023

Copy link
Copy Markdown
Member Author

@dreamflow Would you like to create a PR for that doc change?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dreamflow dreamflow mentioned this pull request Dec 18, 2023
gh-108113: docs : mention PyCF_OPTIMIZED_AST in ast Compiler Flags #113241
Merged
@dreamflow

dreamflow commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

@iritkatriel yes , i'm happy to 🙂

have posted the PR #113241

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel iritkatriel mentioned this pull request Oct 30, 2024
The method for storing docstrings in code objects is awkward and prevents optimizations. #126072
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@carljm carljm carljm left review comments
@corona10 corona10 corona10 approved these changes
@isidentical isidentical Awaiting requested review from isidentical isidentical is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

compile() with PyCF_ONLY_AST flag ignores the optimize arg

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@iritkatriel @dreamflow @carljm @corona10 @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.