Skip to content

Switch to using Python ternary op#4709

Merged
bdbaddog merged 1 commit intoSCons:masterfrom
mwichmann:maint/ternary
Apr 11, 2025
Merged

Switch to using Python ternary op#4709
bdbaddog merged 1 commit intoSCons:masterfrom
mwichmann:maint/ternary

Conversation

@mwichmann
Copy link
Collaborator

Python 2.5 introduced a better approach than c and x or y which is less error-prone, and, these days, and presumably more familiar to readers, as for the last 20 years Python programmers probably won't have been taught the and/or form.

For the most part this is behind the scenes - tools, tests, framework. It rises to visibility if someone looks hard at a few construction variables which now use the new form: _SHLIBVERSION, PCHPDBFLAGS, CCPDBFLAGS. There is no behavioral change even in those cases.

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt and RELEASE.txt (and read the README.rst).
  • I have updated the appropriate documentation

Python 2.5 introduced a better approach than "c and x or y"
which is less error-prone, and, these days, more familiar to readers.

Signed-off-by: Mats Wichmann <mats@linux.com>
@mwichmann mwichmann added the maintenance Tasks to maintain internal SCons code/tools label Apr 9, 2025
@mwichmann mwichmann added this to 4.10 Apr 10, 2025
@mwichmann mwichmann moved this to In review in 4.10 Apr 10, 2025
@bdbaddog bdbaddog merged commit 0d888fc into SCons:master Apr 11, 2025
8 of 10 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in 4.10 Apr 11, 2025
@mwichmann mwichmann added this to the NextRelease milestone Apr 11, 2025
@mwichmann mwichmann deleted the maint/ternary branch April 11, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Tasks to maintain internal SCons code/tools

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants