[Python-ideas] "Assignment expression" with function call-alike syntax

Kirill Balunov kirillbalunov at gmail.com
Wed May 23 13:59:20 EDT 2018


2018-05-23 9:05 GMT+03:00 Terry Reedy <tjreedy at udel.edu>:

> On 5/22/2018 5:32 PM, Kirill Balunov wrote:
>
>> Just one more variation on "assignment exression" syntax to make the list
>> more complete :) Sorry, if something similar has already been suggested.
>> The idea is to use function's call-like syntax in the from: `this( name =
>> expr )`.
>>
>
> Functions names should be verbs.  For this one, 'bind' or even better,
> 'let' as in 'let(name=expr)'


It only looks like a function call, but in fact it should be an _magic
object_ that can on the call bind a name to an expression in the current
local scope. I chose `this` because in my opinion it is easily
perceived: `while
this( name = expr ) > 0`  can be readed as  "While this name assigned to an
expression is  greater than zero do..." the same interpretation for `if`
statement.

With kind regards,
-gdg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180523/0b47cf9d/attachment.html>


More information about the Python-ideas mailing list