[Python-ideas] Inline assignments using "given" clauses

Juancarlo Añez apalala at gmail.com
Sat May 5 06:24:07 EDT 2018


I think that "expr as y"  was discarded too quickly.

It would be a syntax completely familiar to Python programmers, and the new
semantics would be obvious. That choice would also be in line with the Zen
of Python.

The special cases that may arise over "except"  and "with"  can be worked
out and documented.

Cheers,

On Sat, May 5, 2018 at 5:22 AM, Robert Vanden Eynde <robertve92 at gmail.com>
wrote:

> I agree it would be useful to have new keywords without being reserved,
> and we could even go with mechanism like infix operators created by user.
>
> It would allow things like [given for x in range(5) given given = x+1] or
> even [given for given in range(given) given given = given + 1] haha, but as
> other pointed out, it would be called Bad practice ^^
>
> By the way, I still prefer "where" to "given".
>
> Le sam. 5 mai 2018 à 10:52, Greg Ewing <greg.ewing at canterbury.ac.nz> a
> écrit :
>
>> Tim Peters wrote:
>> > "async def", "async for", and "async with" statements were added
>> > _without_ making "async" a new reserved word.  It may require pain in
>> > the parser, but it's often doable anyway.
>>
>> There would be less pain if the parser generator could
>> deal with non-reserved keywords more directly.
>>
>> --
>> Greg
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
>


-- 
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180505/42f8a1a4/attachment.html>


More information about the Python-ideas mailing list