Here's a script to find places where this proposal could be useful. Try it on a directory.

import ast
import linecache
import sys
from pathlib import Path

root = Path(sys.argv[1])

def main():
    for path in root.rglob("**/*.py"):
        source = path.read_text()
            tree = ast.parse(source)
        except SyntaxError:

        for node in ast.walk(tree):
            if isinstance(node, ast.Call):
                def is_same_name(keyword: ast.keyword):
                    return (
                            isinstance(keyword.value, ast.Name)
                            and == keyword.arg

                args = node.keywords
            elif isinstance(node, ast.Dict):
                def is_same_name(pair):
                    key, value = pair
                    return (
                            isinstance(value, ast.Name) and
                            isinstance(key, (ast.Constant, ast.Str)) and
                   == key.s

                args = zip(node.keys, node.values)

            threshold = 3
            if sum(map(is_same_name, args)) < threshold:
            print(f'File "{path}", line {node.lineno}')
            for lineno in range(node.lineno, node.end_lineno + 1):
                print(linecache.getline(str(path), lineno), end="")



On Fri, Apr 17, 2020 at 8:40 PM Paul Svensson <> wrote:
On Fri, 17 Apr 2020, Alex Hall wrote:

>Perhaps an easier next step would be to get better data about people's opinions with a simple poll? Is there a standard way to vote on things in this
>but it's easy and may inform what to do next.

For what it's worth, I'm a strong -1 on this whole thing, regardless of syntax.
I think passing a lot of same-named parameters is an anti-pattern, that should be discouraged, not made easier.
Passing an occasional x=x to so some function no disaster;
if it happens often enough to be a problem, IMNSHO, you should look to change your coding style, not the language.

Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct: