Why this matters
Avoids accidental shadowing and improves readability.
Alias imports when names overlap with locals or other modules; keep clear, unique identifiers.
Avoids accidental shadowing and improves readability.
Side-by-side examples engineers can pattern-match during review.
import json
json = make_json() # shadows moduleimport json as jsonlib
payload = jsonlib.dumps(obj)import time; time = 3import time as time_moduleFrom the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.