On Fri, Jul 28, 2017 at 9:31 AM, Chris Barker <chris.bar...@noaa.gov> wrote:
>
>
> On Thu, Jul 27, 2017 at 2:50 PM, Chris Angelico <ros...@gmail.com> wrote:
>>
>> On Fri, Jul 28, 2017 at 7:22 AM, Pavol Lisy <pavol.l...@gmail.com> wrote:
>> > maybe:
>> > for x, y, z from spam:
>> >     print(x, y, z)
>>
>> What you're asking for is something like JavaScript's "object
>> destructuring" syntax.
>
>
> Wasn't there just a big long discussion about something like that on this
> list?

Yeah, and the use cases just aren't as strong in Python. I think part
of it is because a JS function taking keyword arguments looks like
this:

function fetch(url, options) {
    const {method, body, headers} = options;
    // ...
}
fetch("http://httpbin.org/post";, {method: "POST", body: "blah"});

whereas Python would spell it this way:

def fetch(url, *, method="GET", body=None, headers=[]):
    ...

fetch("http://httpbin.org/post";, method="POST", body="blah");

So that's one big slab of use-case gone, right there.

ChrisA
_______________________________________________
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