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.

delegation, 527–528, 556descriptor files, 86, 182design patterns, 462destructor method, 505developer productivity, 4, 5development tools for largerprojects, 631–634diamond pattern, inheritancechange, 546–549example, 547explicit conflict resolution, 547_ _dict_ _ attribute, 477, 508, 528dict constructor call, 270dictionaries, 67, 79–84, 160–171accessed by key, not offset, 160assigning to new indexes, 166avoiding missing-key errors, 167basic operations, 162changing in-place, 163common literals and operations, 161dictionary interfaces, 169iteration and optimization, 83keys, 80, 162, 166language table, 165len function, 162mapping operations, 79missing keys, 84more methods, 163namespace, 508–511nesting, 80of the category mutable mapping, 160other ways to make, 169pop method, 164sequence operations, 166simulating flexible lists, 166sorting keys, 81–83sparse data structures, 167tables of object references (hashtables), 161unordered collections of arbitraryobjects, 160update method, 164usage notes, 166using as records, 168variable-length, heterogeneous, andarbitrarily nestable, 160dictionary braces, 209dictionary keys, 510dictionary-based records, 519dir function, 49, 73, 279distutils, 395modules, 633divisionclassic, 102floor, 102Django, 10_ _doc_ _ attribute, 279, 280, 535docstrings, 239, 279, 280, 282, 535–537, 631main advantage of, 536standards, 282user-defined, 281doctest standard library module, 632documentation sources, 278–290# comments, 279_ _doc_ _ attribute, 280_ _doc_ _ attribute, 279dir function, 279docstrings, 279, 280, 282standards, 282user-defined, 281published books, 279, 290PyDochelp function, 279, 283, 285HTML reports, 279, 285–289standard manual set, 279, 289documenting code, 278–296DOS variables, 644dynamic typing, 14, 112–122missing declaration statements, 112–116garbage collection, 115types, 114variables, objects, and references, 112shared references, 116–121equality, 119–121in-place changes, 118dynamically typed, 68EEclipse, 55, 632else clause, 252embeddingextending types by, 540<strong>Python</strong> in C, 10empty excepts, 584avoiding, 625–627empty strings, 123, 124emulating privacy for instanceattributes, 499–500encapsulation, 461, 518enclosing defs, 312enclosing scopes, 320encoding large character sets, 130Index | 685

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

Saved successfully!

Ooh no, something went wrong!