Why does not Python accept functions with no names?

Dan Stromberg drsalists at gmail.com
Sun Feb 20 12:06:35 EST 2022


On Sun, Feb 20, 2022 at 7:33 AM Abdur-Rahmaan Janhangeer <
arj.python at gmail.com> wrote:

> Greetings list.
>
> Out of curiosity, why doesn't Python accept
> def ():
>     return '---'
>
> ()
>
> Where the function name is ''?
>

() is already an empty tuple.  It would break code to change this.


More information about the Python-list mailing list