On Fri, Oct 8, 2021 at 8:31 AM Jelle Zijlstra <jelle.zijls...@gmail.com> wrote:
> El vie, 8 oct 2021 a las 0:54, Paul Moore (<p.f.mo...@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) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/UI2JGJ56RIUV65ULATP3JP4FJGUQSZAI/ Code of Conduct: http://python.org/psf/codeofconduct/