Hacker News new | past | comments | ask | show | jobs | submit login

I'm curious how this is valid Python:

  def fib(n: int) -> Iterator[int]:


  - Colon inside argument list
  - Arrow and type
What are they used for normally?



They're generic Function Annotations: https://www.python.org/dev/peps/pep-3107/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: