1

I came across a library code that has the following function definition

def __init__(self, config: 'Configuration') -> None:

The syntax is valid for Python 3 but invalid for Python 2.7. So my question is what is the meaning of the config: 'Configuration' and -> None in the above code?

Farhan Bhoraniya
  • 81
  • 1
  • 1
  • 5
  • They are [type hints](https://www.python.org/dev/peps/pep-0484/). – FChm Feb 27 '19 at 07:44
  • Those are type annotations. Basically no impact on the code just makes it clear what to expect. Here `__init__` expects a Configuration as `config` and returns `None` – Marvin Taschenberger Feb 27 '19 at 07:45

0 Answers0