0

I am trying to understand a python program and its using pytest framework to write tests. In the definition of functions the arguments are passed in the following way:

def get_name(a: ABC, b:DEF) -> str

where ABC and DEF are classes, Can anyone help me to understand what is happening here and why are we using a:ABC, couldn't I just write a = ABC? I have tried finding this way of passing arguments but no luck.

  • 1
    It's typing as defined here: https://docs.python.org/3/library/typing.html – mechanical_meat Feb 27 '20 at 18:54
  • 1
    Does this answer your question? [What does the colon inside the parameter mean?](https://stackoverflow.com/questions/41648300/what-does-the-colon-inside-the-parameter-mean) – AMC Feb 27 '20 at 18:59

0 Answers0