Possibly Pythonic Tail Call Optimization (TCO/TRE)

Marko Rauhamaa marko at pacujo.net
Wed Jul 15 12:55:57 CEST 2015


Ned Batchelder <ned at nedbatchelder.com>:

> On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
>> The other problem for tail call elimination is the requirement that
>> functions return None by default. Smooth tail call elimination would
>> require that Python leave the default return value unspecified.
>
> I don't understand this, can you explain more? Are you saying that the
> Python specification shouldn't specify what x becomes?:
>
>     def who_knows():
>         pass
>
>     x = who_knows()

Yes, that's what I'm saying. The implementation would be free to assign
any value whatsoever to x.


Marko


More information about the Python-list mailing list