Re: passing/catching a variable number of args in python

Steven D. Majewski (sdm7g@aemsun.med.Virginia.EDU)
Mon, 9 Dec 91 16:36:23 EST

My notion was that:

a,b = 1,2,3

should unpack as:
a = 1 ; b = ( 2, 3 )

and:

a,b,c = 1,2

as:
a = 1; b = 2; c = None

I'm not sure that if it came to a vote, I would vote for my own
proposal - just thinking out loud at the moment.

I see the case as to whether or not an arg mismatch should raise an
error/exception as similar to the pro-con type checking argument:
If python is intended for quickie programming, then it should
*REQUIRE* the minimum in type checking & other strictness. Given
any statement it should try to do something sensible ( within some
sensible bounds ). I believe you WILL want type checking or some sort
of consistency checking in larger programs/modules. In that case
there should be a "Python-lint" or some such program external to the
compiler/interpreter.

But I won't kill for that belief (yet :-)
( Also, as I said before, I don't know how the value 'None' is
represented. )

Maybe Guido can give us some more details on consistency checking
in ABC. ( Or maybe I'll get off my duff and read the ABC doc's myself.)

- Steve