From: "holger krekel" <pyth@devel.trillke.net> > IIRC nobody on c.l.py has come up with a real need > for short-circuiting with the ternary op, anyway. Here's a copy of my reply to Aahz and c.l.py: It is necessary when: 1. One of the alternatives has a side-effect; or 2. one or both alternatives are time consuming; or 3. the validity of the alternatives depends on the outcome of the test. # Example where all three reasons apply data = isinstance(source, str) ?? source.readlines() || source.split() 1. readlines() moves the file pointer 2. for long sources, both alternatives take time 3. split() is only valid for strings and readlines() is only valid for file objects. Raymond Hettinger
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