Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-07 Thread Jeff McAninch
Should be legal, right?, since syntax would be expression except expression if exception Dino Viehland wrote: On option 1 is this legal then? x = float(string) except float('nan') if some_check() else float('inf') if ValueError Thinking more about the syntax options: if P.J.'s if Option

[Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-05 Thread Jeff McAninch
educated. Thanks, Jeff McAninch -- == 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

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-05 Thread Jeff McAninch
Raymond Hettinger wrote: If accepted, this would also solve the feature requests for various functions to have default arguments. For example: x = min(seq) except ValueError else 0 # default to zero for empty sequences It would also be helpful in calculations that have algebraic