On Fri, Oct 8, 2021 at 8:31 AM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
El vie, 8 oct 2021 a las 0:54, Paul Moore (<p.f.moore@gmail.com>) escribió:
Also, note that I automatically used a type of int->int up there. As
someone else asked, is that form allowed, or is it required to be
(int)->int? In my view, if we require the latter, I expect there will
be a *lot* of people making that mistake and having to correct it.

That's not something we discussed before. I'd be OK with allowing this unless it makes the grammar too ambiguous.

Even if it didn't make the grammar ambiguous (and I think it doesn't, as long as the argument type isn't a union or another callable type), I'd be against this.

An argument list is not a tuple, and we don't allow omitting the parentheses in other call-related situations: you can't write "def f x: return x+1" and you can't write "f 42". Allowing the omission of the parentheses here would be inconsistent (even if some other languages allow it).

--
--Guido van Rossum (python.org/~guido)