0

I keep seeing functions like

async def coro(self, a, b, /) -> None:
    ...

What does the / at the end mean?

I've googled "/" in python, "/" in function parameters in python and a few other things and i just cant find an answer, so what does it do?

  • 1
    I'm curious how you tried researching this question before asking? A useful tip is to use `site:stackoverflow.com` when Googling to search just StackOverflow. Using the query `site:stackoverflow.com python slash in arguments`, the first 5 hits are all direct answers to this question. – Brian61354270 Mar 30 '23 at 22:36
  • 1
    It's described in the [official Python documentation](https://docs.python.org/3/reference/compound_stmts.html#function-definitions). Specifically: *Changed in version 3.8: The / function parameter syntax may be used to indicate positional-only parameters. See PEP 570 for details.* – Tom Karzes Mar 30 '23 at 22:39
  • @Brian61354270 I think its because I used "/" instead of "slash" – dnbow.asker Apr 01 '23 at 12:42

0 Answers0