12.07.2015 Views

Is Python a

Is Python a

Is Python a

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Applying Functions to Arguments 350The apply Built-in 350Passing keyword arguments 351apply-Like Call Syntax 351Mapping Functions over Sequences: map 352Functional Programming Tools: filter and reduce 353List Comprehensions Revisited: Mappings 355List Comprehension Basics 355Adding Tests and Nested Loops 356List Comprehensions and Matrixes 358Comprehending List Comprehensions 360Iterators Revisited: Generators 360Generator Function Example 362Extended Generator Function Protocol: send Versus next 364Iterators and Built-in Types 364Generator Expressions: Iterators Meet List Comprehensions 365Timing Iteration Alternatives 366Function Design Concepts 369Functions Are Objects: Indirect Calls 370Function Gotchas 371Local Names Are Detected Statically 372Defaults and Mutable Objects 373Functions Without returns 375Enclosing Scope Loop Variables 375Chapter Summary 375Brain Builder 377Chapter Quiz 377Quiz Answers 377Brain Builder: Part IV Exercises 379Part V.Modules18. Modules: The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Why Use Modules? 385<strong>Python</strong> Program Architecture 386How to Structure a Program 387Imports and Attributes 387Standard Library Modules 389xx | Table of Contents

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!