Jeff McAninch wrote: > 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 is used, > it should also be optional. > That is, I would want this to also be legal, > <expression> except <expression> > to trap any exception when robustness is more important than catching a > specific exception. Catch all exceptions: <expression> except <expression> Catch specific exceptions, optionally catching all others: <expression> except (<expression> if <exception>)+ [else <expression>] Of course, a catch-all is a bare except, with all its dangers! > > What would be the typical next step in trying to put this forward? A > draft PEP? >
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4