> > But I cannot do this:
> >
> >     def f(x as (a, b)):
> >             # ...

> > which is what I was suggesting.

> Yeah, I knew that. How important is that to you?

I would really have liked it for a program I was working on at one time that
had lots of small methods that passed around values of forms such as
(a,(b,c)).  Each method would pick one or more of the components out of its
compound value and then would sometimes pass the entire value down to the
next level.

Of course I could do it this way:

        def f(x):
                (a,(b,c)) = x
                # ...

but in this particular application, "as" would have offered significant
extra convenience.

I understand that this is not a real big deal, which is why I haven't
written up a PEP :-)


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to