Violation of PEP8 programming recommendations Info

Following PEP8 makes your code clear and more readable. Often there are several ways to perform a similar action in Python. PEP 8 provides recommendations to remove that ambiguity and preserve consistency.

Detector ID
python/pep8-recommendations@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-

Noncompliant example

1def readable_noncompliant():
2    # Noncompliant: violates PEP8 programming recommendations,
3    # making it difficult to read.
4    if not a is None:
5        print(a)

Compliant example

1def readable_compliant():
2    # Compliant: follows the PEP8 programming recommendations,
3    # improving readability.
4    if a is not None:
5        print(a)