Nick Coghlan wrote:
Option 1:

Change the relative order of the clauses by putting the exception
definition last:

  x = float(string) except float('nan') if ValueError
  op(float(string) except float('nan') if ValueError)

I actually like this one (that's why I listed it first). It gets the
clauses out of order relative to the statement, but the meaning still
seems pretty obvious to me.

Since I don't know the parser coding, I won't comment on the relative 
implentability (implementableness?) of the syntax options that Nick,
P.J. and Raymond suggested.  But all seem readable and debugable.

Nick's option 1 seems like it might be the most understandable to a Python novice.

Would the full syntax include multiple Exceptions after the "if"?

Jeff

--
==========================
Jeffrey E. McAninch, PhD
Physicist, X-2-IFD
Los Alamos National Laboratory
Phone: 505-667-0374
Email: mcani...@lanl.gov
==========================

_______________________________________________
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