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.

inheritance (continued)example, 547explicit conflict resolution, 547each object.attribute reference invokesnew, independent search, 469example, 470–471extension coding pattern, 489hierarchy, 451instances inherit attributes from allaccessible classes, 469logic changes are made by subclassing,not by changing superclasses, 469modeling real-worldrelationships, 521–523mulitple, 560–561multiple, 529–531redefining inherited names, 488specializing inherited methods, 488superclasses listed in parentheses in classheader, 469tree-searching model, 488_ _init_ _ constructor logic, 605_ _init_ _ method, 458, 475, 492_ _init_ _.py files, 416input prompt, 35installation and configuration, 23, 639–645checking to see if <strong>Python</strong> is alreadyinstalled, 639configuring <strong>Python</strong>, 641–645DOS variables, 644environment variable settings, 642path files, 645setting options, 644shell variables, 644Windows options, 645installation steps, 640installing <strong>Python</strong> interpreter, 639–641where to fetch <strong>Python</strong>, 639instance methods, 555instances, 454, 455_ _class_ _ attribute, 509attributes, 487emulating privacy, 499–500multiple, 452sending extra data and behaviorin, 611–613int function, 105, 136, 212integers, 94literals, 94log, 103numeric precision and long integers, 94integrated development environment (seeIDEs)integrationcomponents, 10with C, 15interactive coding, 34–37testing code, 36interactive loops, 210–214doing math on user inputs, 211nested code, 214simple, 210testing inputs, 212interactive promptcompound statements, 37indentation, 37prompt changes, 37testing code at, 36using, 37interactive testing, 441intercepting instance-indexingoperations, 493interfaces, programming, 9internationalization, 130Internet scripting, 10Internet, utility modules, 10interpreter, 22–24conventions, 227intersect function, 307introspection, 435Iron<strong>Python</strong>, 11, 29is not operator, 96is operator, 96“is-a” links, 522_ _lt_ _ method, 492iter function, 262, 362_ _iter_ _ method, 493–498iterationsalternatives, 366–369timing, 366overloading, 493protocol, 83, 261strings, 133iterators, 360–366built-in types and, 364generator expressions, 365user-defined, 494–498multiple iterators on one object, 496Jjoin method, 146, 264just-in-time (JIT) compiler, 30Jython, 10, 28690 | Index

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

Saved successfully!

Ooh no, something went wrong!