[Python-ideas] Any chance on (slowly) deprecating `eval` and `exec` as builtins?

Ethan Furman ethan at stoneleaf.us
Wed Nov 8 13:08:20 EST 2017


On 11/07/2017 03:12 PM, Soni L. wrote:

> exec("def one(x):\n [r] = x\n return r")  # who says python doesn't have one-liners?
>
> (ofc, some would argue you should use:
>
> one = (lambda x: (lambda y: y)(*x))

Most would argue that

def one(x):
    [r] = x
    return r

is the appropriate code.

--
~Ethan~



More information about the Python-ideas mailing list