Dino Viehland wrote: > MRAB wrote: >> Dino Viehland wrote: >>> On option 1 is this legal then? >>> >>> x = float(string) except float('nan') if some_check() else float('inf') if >> ValueError >> Well, is this is legal? >> >> try: >> x = float(string) >> except some_check(): >> x = float('nan') >> except ValueError: >> x = float('inf') >> > > I was thinking this was would be equal to: > > x = float(string) except (float('nan') if some_check() else float('inf')) if ValueError > I suppose it depends on the precedence of 'x except y if z' vs 'x if y else y'.
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