Functional Python Programming
Decorator Design Techniques For this reason, it is often necessary to provide a separate cleansing function that's bundled in wi ...
Chapter 11 Or, we could include the conversion function as an argument to the decorator for a cleansing function as follows: @th ...
Decorator Design Techniques We can use the integer conversion as follows: drop_punct("1,701") 1701 drop_punct("97") ...
Chapter 11 Summary In this chapter, we've looked at two kinds of decorators: the simple decorator with no arguments and paramete ...
...
The Multiprocessing and Threading Modules When we eliminate complex, shared state and design around non-strict processing, we ca ...
The Multiprocessing and Threading Modules The most effective parallel processing occurs where there are no dependencies among th ...
Chapter 12 On a computer with multiple CPUs or multiple cores in a single CPU, there can be some actual concurrent processing of ...
The Multiprocessing and Threading Modules Multiple threads, on the other hand, are part of a single process; all threads of a pr ...
Chapter 12 We have two approaches to interleaving computation and I/O. They are as follows: We can try to interleave I/O and ca ...
The Multiprocessing and Threading Modules An application that analyzes multiple logfiles is also a good candidate for paralleliz ...
Chapter 12 Clearly, we want to interleave the other operations so that they are not waiting for I/O to complete. We can interlea ...
The Multiprocessing and Threading Modules There are several other ways to produce similar output. For example, here is an altern ...
Chapter 12 r"(?P\d+)\s+" r"(?P\S+)\s+" r'"(?P.?)"\s+' # [SIC] r'"(?P.+?)"\s' ) We can use this regular expression to break each ...
The Multiprocessing and Threading Modules There are some alternative ways to do this. For example, we can revise the use of the ...
Chapter 12 The access attribute is the original Access object. The time attribute is the parsed access.time string. The method, ...
The Multiprocessing and Threading Modules Parsing the user agent is challenging. There are many variations; we've chosen a commo ...
Chapter 12 except ValueError as e: print(e, repr(access)) return filter(None, map(access_detail_builder, iterable)) We've change ...
The Multiprocessing and Threading Modules if not any(path): continue if any(p in name_exclude for p in path): continue final= pa ...
Chapter 12 This version has the advantage of being slightly easier to expand when we add new filter criteria. The use of generat ...
«
8
9
10
11
12
13
14
15
16
17
»
Free download pdf