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-115177: Clarify impact of -O and optimization in assert statement documentation by NXPY123 · Pull Request #119305 · python/cpython

Conversation

@NXPY123

@NXPY123 NXPY123 commented May 21, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown

The current simple_stmts.html#the-assert-statement text mentions -O as a tiny hyperlink over to #cmdoption-O but doesn't mention the PYTHONOPTIMIZE environment variable. This commit adds a hyperlink to it and adds a note warning of breaking logic when using assert statements in code. Fixes #115177

  • Issue: Improve the assert statement documentation to clarify impact of -O and optimization #115177

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

Sorry, something went wrong.

Uh oh!

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

All reactions
NXPY123 added 2 commits May 21, 2024 13:40
@NXPY123
pythongh-115177: Mention PYTHONOPTIMIZE environment variable disables…
0e24f4d
… asserts in assert statement documentation

* The current simple_stmts.html#the-assert-statement text mentions -O as a tiny hyperlink over to #cmdoption-O but doesn't mention the PYTHONOPTIMIZE environment variable. This commit adds a hyperlink to it.
@NXPY123
gh:115177: Add Note to assert statement docs warning about possible i…
68f092c
…ssues with code containng assert statements when optimization is enabled

Added a remainder that logic could break when optimization is enabled when using assert statements in code. Mentioned that it's considered best practice to not use assert statements to evaluate function variables.
@ghost

ghost commented May 21, 2024 •
edited by ghost
Loading

Uh oh!

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

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news awaiting review labels May 21, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 21, 2024
Improve the assert statement documentation to clarify impact of -O and optimization #115177
Open
nineteendo
nineteendo reviewed May 21, 2024
View reviewed changes
Comment thread Doc/reference/simple_stmts.rst Resolved

Uh oh!

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

@NXPY123 @nineteendo
pythongh-115177: Add line break to align text in assert statement doc
39f4a3a
Co-authored-by: Nice Zombies <[email protected]>
nineteendo
nineteendo reviewed May 21, 2024
View reviewed changes
Comment thread Doc/reference/simple_stmts.rst Resolved

Uh oh!

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

@NXPY123 @nineteendo
pythongh-115177: Add line break to align text in assert statement doc
82922f9
Co-authored-by: Nice Zombies <[email protected]>
@python-cla-bot

python-cla-bot Bot commented Apr 18, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

  • [email protected]

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 16, 2026
@StanFromIreland

StanFromIreland commented Jun 5, 2026

Copy link
Copy Markdown
Member

Closing as stale, the CLA is unsigned and there are conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland StanFromIreland closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@nineteendo nineteendo nineteendo left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Improve the assert statement documentation to clarify impact of -O and optimization

Uh oh!

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

3 participants

@NXPY123 @StanFromIreland @nineteendo
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.