Skip to Content
Functional Python Programming - Second Edition
book

Functional Python Programming - Second Edition

by Steven F. Lott
April 2018
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 42m
English
Packt Publishing
Content preview from Functional Python Programming - Second Edition

Evaluating conditional expressions

Python imposes strict ordering on expressions; the notable exceptions are the short-circuit operators, and and or. It imposes strict ordering on statement evaluation. This makes it challenging to find optimizations because they would break the strict evaluation order.

Evaluating condition expressions is one way in which we can experiment with non-strict ordering of statements. The if, elif, and else Python statements are evaluated in a strict order from first to last. Ideally, an optimizing language may relax this rule so that a compiler can find a faster order for evaluating the conditional expressions. This allows us to write the expressions in an order that makes sense to a reader, and lets the compiler ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Python Programming - Third Edition

Functional Python Programming - Third Edition

Steven F. Lott

Publisher Resources

ISBN: 9781788627061Supplemental Content