1 > 0 == True -> False

Chris Angelico rosuav at gmail.com
Thu Jan 30 19:01:53 EST 2014


On Fri, Jan 31, 2014 at 10:36 AM, Joshua Landau <joshua at landau.ws> wrote:
> On 30 January 2014 20:38, Chris Angelico <rosuav at gmail.com> wrote:
>>
>> Why is tuple unpacking limited to the last argument? Is it just for
>> the parallel with the function definition, where anything following it
>> is keyword-only?
>
> You're not the first person to ask that:
> http://www.python.org/dev/peps/pep-0448/
>
> If you're able and willing to implement it, I believe the support is
> there. The primary reason I know of for its non-inclusion was that it
> was first proposed (with code) during a feature freeze.

Ah, okay. Glad it's not a fundamentally hard concept. I don't know
that I want to dig into actually implementing that, just now, but I've
added myself as nosy on bug 2292 (which is where the patch is being
discussed, and is referenced in the PEP). I don't have a major
use-case for it in Python, though I've used the equivalent Pike
feature all over the place (it's done as @args where args is an array,
and it's equivalent to listing the args - pretty much the same as
*args in Python) - it's handy, even though it's almost never really
crucial.

It's perhaps telling that the only time I can recall running into this
with Python is in making some deliberately bad code :D

ChrisA



More information about the Python-list mailing list