# Allow identifiers as keyword arguments at function call site (extension of PEP 3102?)

**URL:** <https://discuss.python.org/t/allow-identifiers-as-keyword-arguments-at-function-call-site-extension-of-pep-3102/31677>\
**Category:** Ideas\
**Created:** [August 15, 2023, 10:32am UTC](https://discuss.python.org/t/allow-identifiers-as-keyword-arguments-at-function-call-site-extension-of-pep-3102/31677 "2023-08-15T10:32:54Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![joshuabambrick](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/joshuabambrick/32/15299_2.png) [@joshuabambrick](https://discuss.python.org/u/joshuabambrick)\
**Post date:** [October 14, 2023, 10:30pm UTC](https://discuss.python.org/t/allow-identifiers-as-keyword-arguments-at-function-call-site-extension-of-pep-3102/31677/29 "2023-10-14T22:30:49Z")

</div>

This seems to be a very common idea to make python better, as I suggested something essentially the same here: [Syntactic sugar to encourage use of named arguments](https://discuss.python.org/t/syntactic-sugar-to-encourage-use-of-named-arguments/36217/1)

Only minor caveat was that I propose making the syntax more consistent with python’s long-standing `*args` and `**kwargs` syntax (established pythonic style), i.e.

```auto
my_function(=my_first_variable, =my_second_variable, =my_third_variable)

```

I listed the benefits as:

- Encourages use of named variables, thereby increasing readability (_explicit is better than implicit_) and reducing bugs from argument transposition
- Reduces verbosity (_readability counts_)
- Encourages authors to use the same variable name when calling a function as the argument (increases consistency of variable names used, thereby increasing _readability_)
- Reminiscent of python’s long-standing `*args` and `**kwargs` syntax (established pythonic style)
- Reminiscent of python’s existing f-string debug `f'{var=}'` syntax (established pythonic style) and with a very similar function
- This should be relatively easy to implement as it is simple syntactic sugar (_if the implementation is easy to explain, it may be a good idea_)
- Backwards compatibility: this change is fully backwards compatible since the proposed syntax would raise a syntax error in current python versions

I think some confusion may be caused by the OP’s suggestion to automatically expand arguments without any change in syntax. I’d oppose that for the reasons as listed, but I think these issues are entirely ameliorated by the proposed `=` syntax:

- the changes are entirely local at the call site `f(=a)` is immediately expanded into `f(a=a)`
- there is no confusion about how to match variables to arguments (at least, none more than existing function call syntax)
- it does not require looking at the function called

---

_[View the full topic](https://discuss.python.org/t/allow-identifiers-as-keyword-arguments-at-function-call-site-extension-of-pep-3102/31677)._
