12.07.2015 Views

Is Python a

Is Python a

Is Python a

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

imports and reloads, 45–50example, 47–49multiple imports, 46namespaces, 49usage notes, 49mixed usage modes, 428–430unit tests with _ _name_ _, 429namespaces, 49, 404–409attribute name qualification, 407files generating, 405–406imports versus scopes, 407nesting, 408nested, 53number tools, 106once loaded, 406PYTHONPATH directories, 391relative import syntax, 431–434reload function, 385reloading, 409–412basics, 410details, 410example, 411in larger systems, 412search path, 390–392shared library, 389standard library directories, 391system namespace partitioning, 386usage, 399–404versus classes, 537when imported, 399why use, 385Monty <strong>Python</strong>’s Flying Circus, 18multiple inheritance, 529–531, 560–561multiple instances, 452multiple-target assignments, 219, 222shared references, 222multiway branching, 237–239mutability, 123mutable objects, 373mutable types, 150mutables in assignments, 292MySQL, 11N_ _name_ _ attribute, 428_ _name_ _ check, 429_ _name_ _ method, 428namespaces, 47, 49, 310, 506–515attribute names, 506classes, 482classifying names, 506–508declaration, 316dictionaries, 508–511links, 511object, 506qualified attribute names, 506simple names, 506system namespace partitioning, 386unqualified names, 506namespaces (modules), 404–409attribute name qualification, 407files generating, 405–406imports versus scopes, 407nesting, 408naming conventions, 227assigning same name, 227negation operator, 96negative offsets, strings, 133nested function scopes, 320lambda, 348lambdas and, 324nested functions, 320–326nested loops, 356–358nested modules, 53.NET, 11new-style classes (see classes, new-style)next method versus send method, 364NLTK package, 12noncompound statements, 242None object, 189not in operator, 96not operator, 96NotImplementedError exception, 490NULL pointer in C, 189numbers, 67, 68, 93–111, 150basic operations, 99built-in number literals, 95complex, 95complex numbers, 104display formats, 100expression operators (see expressionoperators)mixing numeric types, 98numeric literals, 94–95print statements, 100numeric precision and long integers, 94numeric programming, 11NumPy, 11, 95Oobfuscating code, how not to, 347object classifications, 183object flexibility, 183object namespaces, 506Index | 693

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

Saved successfully!

Ooh no, something went wrong!