PEP 8: Add green and red sidbar for good and bad examples#3567
Uh oh!
There was an error while loading. Please reload this page.
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.


As suggested in python/docs-community#22.
Like https://pep8.org, add green and red borders on the left side of "good" and "bad" code examples.
For example:
(This PR also removes redundant
Version,Last-ModifiedandContent-Typeheaders, andLocal Variables:footer.)Accessibility check: colourblindness
We are not relying on colour to convey information; as before, the info about whether examples are good or bad is conveyed via the text.
We can later apply this to other good/bad code examples in other PEPs, such as the dangerous SQL code in PEP 675.
Question
I only added green/red for examples that are comparatively marked as correct or wrong (or similar). I left the other examples unmarked. But I think we could also mark those green, because they too are examples of good/allowed style. Thoughts?
📚 Documentation preview 📚: https://pep-previews--3567.org.readthedocs.build/pep-0008/