3 ms·
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?
by barumrho 12y ago
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?
- icebraining 12y agoThey're generic Function Annotations: https://www.python.org/dev/peps/pep-3107/ https://www.python.org/dev/peps/pep-3107/