Functional Python Programming

(Wang) #1

sets
using 50 - 53
shifty() function 40
Sieve of Eratosthenes algorithm 98
simple numerical recursions
about 118 , 119
collections, processing via
recursion 122 , 123
recursion, leaving in place 120 - 122
tail-call optimization, for collection 123 , 124
tail-call optimization,
implementing 119 , 120
simulation
implementing, with monads 275 - 279
sorted() function
used, for data sorting 100
Spearman rank-order correlation
about 152
computing 152 , 153
stacks of abstractions 17
starmap() function
about 165 , 176 , 258 , 259
used, for applying function to data 176
starmap(function, iterable) method 246
start_response function 287
stateful mappings
using 53 - 55
stateful sets
using 56 , 57
stdev() function 98
storage
optimizing 311
Strategy design pattern 40
strict evaluation 27 - 29
strings
using 41 , 42
string.Template() function 301
systolic_bp() function 271


T


tabulate function 178
Tail recursion example 32
tail recursion optimizations 308 - 310


take function 178
takewhile() function
about 165 , 173 , 259
stateful filtering with 173 , 174
tee() function
about 177
iterators, cloning with 177
total_ordering decorator
about 201
classes, defining with 201 - 203
true conditional expressions
filtering 256
tuples 42 , 43

U
unique_everseen function 179
unique_justseen function 179
update_wrapper() function
about 216
using 216 , 217

W


Web Server Gateway Interface. See WSGI
web services, defining as functions
about 291
data, serializing into CSV format 298 , 299
data, serializing into HTML 300 , 301
data, serializing into JSON format 298
data, serializing into XML 299 , 300
filter, applying 295 , 296
raw data, obtaining 294 , 295
results, serializing 296 - 298
WSGI application, creating 292 - 294
wget 282
wrapper() function
using 215
wrapping
parallelism 149
serialism 149
Wrap-Unwrap design patterns
about 145
applying 146
writerows() method 299
Free download pdf