ut that’s what we have in Python 2.

* * *

  1. The following few examples assume either Python 3, or that ` print_function ` is imported from the ` __future__ ` module if using Python 2.  ↩ 
  2. The fourth invocation option, i.e. saying ` foo(x=5, 10) ` , is not listed, because it is a syntax error – positional arguments must precede any keyword arguments.  ↩ 

###  Share this:

  * [ Twitter  ](https://blog.peterlamut.com/2017/11/10/keyword-only-arguments-in-python/?share=twitter "Click to share on Twitter")
  * [ Facebook  ](https://blog.peterlamut.com/2017/11/10/keyword-only-arguments-in-python/?share=facebook "Click to share on Facebook")
  * 

Like  Loading...

![](https://1.gravatar.com/avatar/47889a61e55c396e2ea18b0de05fa8a63f36cf32eddcf552613be0ebca37fb83?s=49&d=identicon&r=G)
Author  [ Peter Lamut ](https://blog.peterlamut.com/author/peterlamut/) Posted
on  [ November 10, 2017  November 10, 2017
](https://blog.peterlamut.com/2017/11/10/keyword-only-arguments-in-python/)
Tags  [ Function arguments ](https://blog.peterlamut.com/tag/function-
arguments/) , [ Python ](https://blog.peterlamut.com/tag/python/) [ Leave a
comment  on Keyword-only arguments in Python
](https://blog.peterlamut.com/2017/11/10/keyword-only-arguments-in-
python/#respond)

##  About the Author

![](https://1.gravatar.com/avatar/47889a61e55c396e2ea18b0de05fa8a63f36cf32eddcf552613be0ebca37fb83?s=96&d=identicon&r=G)  
I am an experienced software engineer, primarily using Python and JavaScript
in my day-to-day work, putting a strong emphasis on writing clean and
maintainable code.

I use Linux, like to crack jokes, and enjoy attending developer meetups and
conferences like EuroPython.

I do not own any pets or hair care products.

Search for:  Search

##  Tags

  * [ Attribute lookup ](https://blog.peterlamut.com/tag/attribute-lookup/)
  * [ ChainMap ](https://blog.peterlamut.com/tag/chainmap/)
  * [ Classmethod ](https://blog.peterlamut.com/tag/classmethod/)
  * [ CPython internals ](https://blog.peterlamut.com/tag/cpython-internals/)
  * [ Debugging ](https://blog.peterlamut.com/tag/debugging/)
  * [ Decorators ](https://blog.peterlamut.com/tag/decorators/)
  * [ Descriptors ](https://blog.peterlamut.com/tag/descriptors/)
  * [ Dictionary ](https://blog.peterlamut.com/tag/dictionary/)
  * [ Enum ](https://blog.peterlamut.com/tag/enum/)
  * [ Function arguments ](https://blog.peterlamut.com/tag/function-arguments/)
  * [ General ](https://blog.peterlamut.com/tag/general/)
  * [ Metaclasses ](https://blog.peterlamut.com/tag/metaclasses/)
  * [ Python ](https://blog.peterlamut.com/tag/python/)
  * [ remote work ](https://blog.peterlamut.com/tag/remote-work/)
  * [ Sentinel ](https://blog.peterlamut.com/tag/sentinel/)
  * [ Sequences ](https://blog.peterlamut.com/tag/sequences/)
  * [ Slices ](https://blog.peterlamut.com/tag/slices/)
  * [ SQLAlchemy ](https://blog.peterlamut.com/tag/sqlalchemy/)

##  Archives

  * [ April 2020 ](https://blog.peterlamut.com/2020/04/)
  * [ June 2019 ](https://blog.peterlamut.com/2019/06/)
  * [ February 2019 ](https://blog.peterlamut.com/2019/02/)
  * [ November 2018 ](https://blog.peterlamut.com/2018/11/)
  * [ May 2018 ](https://blog.peterlamut.com/2018/05/)
  * [ February 2018 ](https://blog.peterlamut.com/2018/02/)
  * [ December 2017 ](https://blog.peterlamut.com/2017/12/)
  * [ November 2017 ](https://blog.peterlamut.com/2017/11/)
  * [ October 2017 ](https://blog.peterlamut.com/2017/10/)
  * [ September 2017 ](https://blog.peterlamut.com/2017/09/)

  * [ Home ](/)

  * [ Twitter  ](https://twitter.com/plamut "Twitter: @plamut")
  * [ GitHub  ](https://github.com/plamut "GitHub: plamut")
  * [ StackOverflow  ](https://stackoverflow.com/users/5040035/plamut "StackOverflow profile")
  * [ LinkedIn  ](https://si.linkedin.com/in/peterlamut "LinkedIn profile")

[ Peter Lamut's blog ](https://blog.peterlamut.com/) [ Create a website or
blog at WordPress.com  ](https://wordpress.com/?ref=footer_custom_svg "Create
a we