On Dec 24, 8:22 am, [EMAIL PROTECTED] wrote:
> Recently, I got into a debate on programming.reddit.com about
> what should happen in the following case:
>
> >>> a = ([1], 2)
> >>> a[0] += [3]
>
> Currently, Python raises an error *and* changes the first element of
> the tuple. Now, this seems like something one would want to
> change - why raise an error *and* execute the thing it
> was complaining about?

Yawn.  Multiple actions have been combined into one line.  The first
succeeds and the second fails.

If you need commit-rollback behaviors, specify them explicitly in a
try/except.  My bet is that you'll figure-out that you didn't really
need that behavior to begin with.  No use cluttering and slowing the
language for something like this -- Python is not SQL.


Raymond
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to