Beginning Python - From Novice to Professional

Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional

16.01.2014 Views

Index ■Symbols - operator 558 != operator 558 #! character sequence 21 % character conversion specifiers 56 % operator 558 & operator 558 *operator as distribution operator 123, 124 as gathering operator 121 **operator as distribution operator 123, 124 as gathering operator 122 * operator 558 ** operator 558 + operator 558 concatenating sequences 551 .pyw file extension reasons for 280 / operator 558 = operator 547 == operator 547, 558 > operator 558 >= operator 558 >> operator 558 ^ operator 558 __all__ Variable 212 __delattr__ method implementing properties with old-style classes 188 __delitem__ method basic sequence and mapping protocol 180 __dict__ attribute 156 __doc__ attribute 112 __future__ module 19 __getattr__ method implementing properties with old-style classes 188, 189 __getattribute__ method endless loop trap 189 implementing properties with old-style classes 188 __getitem__ method 182 basic sequence and mapping protocol 180 __init__ method 173, 175 __iter__ method 173, 189, 190 __len__ method basic sequence and mapping protocol 180, 182 __setattr__ method 188 __setitem__ method basic sequence and mapping protocol 180 | operator 558 ~ operator 558 ` ` backticks 551 converting a Python value to a string 25–26 ■A abs function 17, 559 abstraction 109, 139 classes and types 147–148 attributes, functions and methods 149 creating 148 inheritance 153–154 575

576 ■INDEX interfaces 155–156 methods 150–151 multiple superclasses 154–155 namespaces 151–152 superclasses 153 functions creating 111 documenting 112 functional programming 133–137 parameters 113–126 Python functions 112–113 objects 139–140 encapsulation 143–146 inheritance 146–147 polymorphism 140–143 recursion 129–130 binary search 131–133 factorial and power 130–131 scoping 126–127 rebinding global variables 127–128 structure 110 uses 109–110 accessor methods 184–185 action attribute tag 476 action method rule objects 400, 401 ActivePython 571 alternative Python distribution 6 add function operator module 142 add method Set class 223 addFilter method Parser class 401, 402 addition operator (+) 37 addRule method Parser class 401, 402 algorithms 9, 10 alignment 58 allow_reuse_address attribute SimpleXMLRPCServer class 509 and operator 92, 558 apilevel module property Python DB API 286 append method lists 43 appendleft method deque type 226 apply function 137, 559 arcade game 527 first implementation 531–535 further exploration 545 goals 528 preparations 530–531 problem 527 second implementation 535–545 tools 528–530 argv variable sys module 215 arithmetic operators 11 arraysize attribute cursor objects 289 Art of Computer Programming, The Knuth, Donald 387 Art of UNIX Programming, The Raymond, Eric S. 387 as clause import statements 83 open functions 83 asctime function time module 227 assert method TestCase class 348 assert statements 93, 566 assertAlmostEqual method TestCase class 348

576 ■INDEX<br />

interfaces 155–156<br />

methods 150–151<br />

multiple superclasses 154–155<br />

namespaces 151–152<br />

superclasses 153<br />

functions<br />

creating 111<br />

documenting 112<br />

functional programming 133–137<br />

parameters 113–126<br />

<strong>Python</strong> functions 112–113<br />

objects 139–140<br />

encapsulation 143–146<br />

inheritance 146–147<br />

polymorphism 140–143<br />

recursion 129–130<br />

binary search 131–133<br />

fac<strong>to</strong>rial and power 130–131<br />

scoping 126–127<br />

rebinding global variables 127–128<br />

structure 110<br />

uses 109–110<br />

accessor methods 184–185<br />

action attribute<br />

tag 476<br />

action method<br />

rule objects 400, 401<br />

Active<strong>Python</strong> 571<br />

alternative <strong>Python</strong> distribution 6<br />

add function<br />

opera<strong>to</strong>r module 142<br />

add method<br />

Set class 223<br />

addFilter method<br />

Parser class 401, 402<br />

addition opera<strong>to</strong>r (+) 37<br />

addRule method<br />

Parser class 401, 402<br />

algorithms 9, 10<br />

alignment 58<br />

allow_reuse_address attribute<br />

SimpleXMLRPCServer class 509<br />

and opera<strong>to</strong>r 92, 558<br />

apilevel module property<br />

<strong>Python</strong> DB API 286<br />

append method<br />

lists 43<br />

appendleft method<br />

deque type 226<br />

apply function 137, 559<br />

arcade game 527<br />

first implementation 531–535<br />

further exploration 545<br />

goals 528<br />

preparations 530–531<br />

problem 527<br />

second implementation 535–545<br />

<strong>to</strong>ols 528–530<br />

argv variable<br />

sys module 215<br />

arithmetic opera<strong>to</strong>rs 11<br />

arraysize attribute<br />

cursor objects 289<br />

Art of Computer Programming, The<br />

Knuth, Donald 387<br />

Art of UNIX Programming, The<br />

Raymond, Eric S. 387<br />

as clause<br />

import statements 83<br />

open functions 83<br />

asctime function<br />

time module 227<br />

assert method<br />

TestCase class 348<br />

assert statements 93, 566<br />

assertAlmostEqual method<br />

TestCase class 348

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

Saved successfully!

Ooh no, something went wrong!