Nested Parameter Definitions

Arnaud Delobelle arnodel at googlemail.com
Sun Feb 25 15:37:07 EST 2007


On Feb 25, 6: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')

Reminds me of LeLisp! It had a similar feature.  IIRC you could write
for example (I think 'df' was LeLisp for 'defun'):
(df mycar (a . b) a)
or
(df mylist L L)
or
(df mycaadr (a (b . c) . e) b)

I didn't know that this was possible in python and it does surprise
me.  It feels at odd with the python philosophy.

--
Arnaud




More information about the Python-list mailing list