On Tue, Oct 31, 2017 at 11:24 AM, Petr Viktorin <encu...@gmail.com> wrote:

> On 10/31/2017 09:54 AM, Koos Zevenhoven wrote:
>>
>>
>> ​I wonder if that's more easily understood if you write it along these
>> line(s):
>>
>>    (the_bob,) = ​(name for name in ('bob','fred') if name=='bob')
>>
>
> There are (unfortunately) several ways to do it. I prefer one that avoids
> a trailing comma:
>
> [the_bob] = ​(name for name in ('bob','fred') if name=='bob')
>
>
​Maybe it's just me, but somehow that list-like syntax as an assignment
target feels wrong in somewhat the same way that (1, 2).append(3) does.​

––Koos
​
PS. In your previous email, something (your email client?) removed the
vertical line from the quoted Chris's email, so it looks like just an
indented block. I wonder if a setting could fix that.​


-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to