0

I am not familiar with all the python3's new syntax from python2. I have encountered other people's code with this coding pattern.

def foo(*, a: str, b: str, c: str) -> baz:
  ...
  ret = baz()
  return ret.myFunc()
  1. What does * mean in this context?
  2. What is the role of baz in this function? Is it another object we passed into foo?
drdot
  • 3,215
  • 9
  • 46
  • 81
  • 2
    https://docs.python.org/3/glossary.html#term-parameter and https://docs.python.org/3/library/typing.html . – hiro protagonist Mar 09 '22 at 06:21
  • 2
    related questions: https://stackoverflow.com/questions/22248396/keyword-only-parameter, https://stackoverflow.com/questions/53797057/star-as-an-argument-in-python-function, https://stackoverflow.com/questions/32557920/what-are-type-hints-in-python-3-5 . – hiro protagonist Mar 09 '22 at 06:22

0 Answers0