Nested Parameter Definitions

Virgil Dupras hardcoded.software at gmail.com
Sun Feb 25 14:06:03 EST 2007


On Feb 25, 1:00 pm, "Paddy" <paddy3... at googlemail.com> wrote:
> I blogged on finding a new-to-me feature of Python, in that you are
> allowed to nnest parameter definitions:
>
> >>> def x ((p0, p1), p2):
>
> ...     return p0,p1,p2
> ...>>> x(('Does', 'this'), 'work')
>
> ('Does', 'this', 'work')
>
>
>
> Ruben commented that there was a poll on this features continued
> existence taken at PyCon and it could go.
>
> Just as I found it, it could go
>
> I wondered if those of you with some Python experience new of nested
> parameters and don't use them; or just forgot/don't know it is
> possible?
>
> - Paddy.
>
> Oh - the blog entry is athttp://paddy3118.blogspot.com/2007/02/pythons-function-nested-paramet...

I didn't know about it either. Without the call example, I would have
had a hard time to try to figure out what these extra brackets are
for. For this reason, I think that an explicit unpack is more
readable, and thus better.




More information about the Python-list mailing list