[Python-Dev] PEP 343 - next steps

Andrew Koenig ark at acm.org
Mon Jun 13 22:24:37 CEST 2005

> > 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 :-)

More information about the Python-Dev mailing list