Skip to content

PEP 7: Remove Python 2.2 advice, add C syntax highlighting and green/red sidebars - #3702

Merged
hugovk merged 6 commits into
python:mainfrom
hugovk:pep7-c-syntax-hightlighting
Mar 29, 2024
Merged

PEP 7: Remove Python 2.2 advice, add C syntax highlighting and green/red sidebars#3702
hugovk merged 6 commits into
python:mainfrom
hugovk:pep7-c-syntax-hightlighting

Conversation

@hugovk

@hugovkhugovk commented Mar 3, 2024

Copy link
Copy Markdown
Member
  • Remove the section "For C code that needs to support versions of Python older than 2.3...". I can add it back if needed.

  • Highlight the example C code with C syntax instead of Python.

  • Like PEP 8 (PEP 8: Add green and red sidbar for good and bad examples #3567), add green and red side borders "good" and "bad" examples. For this, I split this example into two blocks:

returnalbatross; /* correct */return(albatross); /* incorrect */
  • Format None as None, add a missing full stop. Remove some redundant PEP fields.

Example

Before After
imageimage

📚 Documentation preview 📚: https://pep-previews--3702.org.readthedocs.build/pep-0007/

@willingcwillingc 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.

Lovely @hugovk

@hugovk
hugovk merged commit 3cdfdd9 into python:mainMar 29, 2024
@hugovk
hugovk deleted the pep7-c-syntax-hightlighting branch March 29, 2024 13:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hugovk@JelleZijlstra@willingc@Jamim