Python: Refactor pruning to be more clearly symmetric and complete.
Python: Refactor pruning to be more clearly symmetric and complete.

github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql