[Python-ideas] PEP 484 (Type Hints) -- first draft round

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 20 07:22:48 CET 2015


Stephen Hansen wrote:
> Type hinting is already making function definitions verbose enough as it 
> is. The very idea that we'd have both ":" and "::" in the language and 
> that somehow this isn't ambiguous is completely obscene to me.

If we were to *really* use :: the way Haskell uses it,
then the type information wouldn't be in the function
header. It would be on a separate line, much like a
decorator:

   quack :: lambda float, int: AnimalSound
   def quack(volume, num_times):
      ...

-- 
Greg


More information about the Python-ideas mailing list