[Python-Dev] Re: Syntax for "except"

Terry Reedy tjreedy at udel.edu
Tue Feb 10 13:58:27 EST 2004


"Edward C. Jones" <edcjones at erols.com> wrote in message
news:402901C1.4040405 at erols.com...
> Why was Python syntax designed so
>     except (TypeError, ValueError):
> is OK but
>     except [TypeError, ValueError]:
> is forbidden.

Because one way to do it is enough!  Func[arg] is also forbidden for same
reason.

> Should this be changed?

>From a user viewpoint, definitely NO.  0 benefit, + learning and memory
cost

> Is immutability needed here?

Turn the question around: is mutability needed here?  No, the sequence is
not named (usually) and so there is no possibility of mutation and no use
for it if it is.

Terry J. Reedy






More information about the Python-Dev mailing list