Sounds good indeed. With the name __target_text__
we wouldn’t have to worry about a plural form.
I don’t see why not. We can name the new keyword that forwards local variables to function parameters of the same names, __same__
. The compiler with access to AST can clearly tell which keyword argument a ast.Same
node belongs to and produces bytecode that loads the local variable of that name for the argument accordingly:
call_with_local_args(some_target=__same__)
This is really a completely separate proposal from the assignment target placeholder proposal though, and should be discussed about in a separate thread (perhaps in the PEP-736 thread, in which I have now made a post).
Yeah the loss of brevity does take away the utility of this idea in cases of a single identifier, particularly as an alternative to PEP-736, where parameter names are always single identifiers.
I agree that we should focus more on its utility for more complex assignment targets.