Generate all valid combinations of n pair of parentheses
API

The compute_all_parens function requires 4 parameters.
From a user's perspective,
it would be more natural to require only one,
to avoid confusion about what values to pass for the others.
You could use an inner function to encapsulate your implementation details:

def print_all_parens(n):
    def print_parens(left, right, s):
        if right == n:
            print(s)
            return
        if left &lt; n:
            print_parens(left + 1, right, s + "(")
        if right &lt; left:
            print_parens(left, right + 1, s + ")")

    print_parens(0, 0, "")


I also corrected some formatting issues, following PEP8.

Use generators

Instead of printing, it would be nicer to return a generator:

def compute_all_parens(n):
    def compute_parens(left, right, s):
        if right == n:
            yield s
            return
        if left &lt; n:
            yield from compute_parens(left + 1, right, s + "(")
        if right &lt; left:
            yield from compute_parens(left, right + 1, s + ")")

    yield from compute_parens(0, 0, "")


This will give callers the freedom to do whatever they want with the combinations.