Paul> Now in your new syntax this is essentially Paul> x = if condition then t else f Paul> Therefore it would be cool if the implementation was Paul> x=condition.__where__(t,f). This slot could be overwritten by Paul> classes like Numeric's array. If condition was a list this might Paul> be useful too. Unfortunately, that requires both t and f to be evaluated. In a NumPy setting that's probably not a big deal because in most cases both values will be used in the resulting output. In a scalar context, the short-circuit nature of the expression is often important. If implemented as any kind of function you've lost that capability. -- Skip Montanaro (skip@pobox.com) http://www.mojam.com/ http://www.musi-cal.com/
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