[Python-ideas] Proposal: Use mypy syntax for function annotations

Terry Reedy tjreedy at udel.edu
Sat Aug 23 01:36:53 CEST 2014


On 8/22/2014 3:47 AM, Rock Neurotiko wrote:

> About the syntax, I love the mypy's syntax, and remember me a lot to
> other languages like scala.
>
> def primes_to_n(n: Int) => List[Int]
>
> def primes_to_n(n: int) -> List[int]

The Python version need ':' at the end, after the return type.
I don't think you are the first to omit it.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list