On 04Apr2015 22:45, boB Stepp <[email protected]> wrote:
On Sat, Apr 4, 2015 at 6:55 PM, Alan Gauld <[email protected]> wrote:lambda : all([print('Hello lambda world!'), sys.exit()] )Well, now I am curious as to why the "all" form evaluates BOTH elements. Apparently it does not apply the short-circuit logic we have been discussing, or it would stop evaluating after the print statement return. Why is that?
Because the list/tuple is constructed entirely before all() is called. All() operates only on the final values.
Cheers, Cameron Simpson <[email protected]> Yesterday, I was running a CNC plasma cutter that's controlled by Windows XP. This is a machine that moves around a plasma torch that cuts thick steel plate. �A "New Java update is available" window popped up while I was working. �Not good. - John Nagle
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
