Glossary

algorithm A step-by-step procedure for solving a problem, such as Euclid’s algorithm.

alias Two (or more) variables that refer to the same object.

API (application programming interface) Specification of the set of operations that characterize how a client can use a data type.

array A data structure that stores a sequence of elements, with support for creation, indexed access, indexed assignment, and iteration.

argument An object reference passed to a function.

assignment statement A Python statement consisting of a variable name followed by = followed by an expression, which directs Python to evaluate the expression and to bind the variable to an object holding the resulting value.

binding Association between a variable and an object holding a data-type value.

bit Either of the two binary digits (0 or 1).

booksite module Module created by the authors for use in the book.

built-in function A function built into the Python language, such as max(), abs(), int(), str(), and hash().

built-in type A data type built into the Python language, such as str, float, int, bool, list, tuple, dict, and set.

class The Python construct to implement a user-defined data type, providing a template to create and manipulate objects holding values of the type, as specified by an API.

client A program that uses an implementation via an API.

command line The active line in the terminal application; used to invoke system commands and to run programs.

command-line argument A string passed to a program at the command line.

comment Explanatory text (ignored by the compiler) to help a reader understand the purpose of code.

comparable data type A Python data type that defines a total order using the six comparison operators <, <=, >, >=, ==, and !=, such as int, str, float, and bool.

compile-time (syntax) error An error found by the compiler.

compiler A program that translates a program from a high-level language into a low-level language, such as from the Python programming language to Python bytecode.

constant variable A variable whose associated data-type value does not change during execution of the program (or from one execution of the program to the next).

constructor A special data-type method for creating and initializing a new object.

data structure A way to organize data in a computer (usually to save time or space), such as an array, a resizing array, a linked list, and a binary search tree.

data type A set of values and a set of operations defined on those values.

default value The object assigned to a parameter variable if the function call does not include the corresponding argument.

defining and initializing a variable Binding a variable to an object for the first time in a program.

element One of the objects in an array.

evaluate an expression Simplify an expression to a value by applying operators to the operands in the expression, using precedence rules.

exception An exceptional condition or error at run time.

expression A combination of literals, variables, operators, and function calls (perhaps parenthesized) that can be simplified to produce a value.

function A named sequence of statements that performs a computation.

function call An expression that executes a function and returns a value.

garbage collection The process of automatically identifying and freeing memory when it is no longer in use.

global code Code not inside any function or class definition.

global variable A variable defined outside of any function or class.

hashable data type A data type that defines the built-in function hash() and is suitable for use with dict and set, such as int, str, float, bool, and tuple (but not list).

identifier The name used to identify a variable, function, class, module, or other object.

immutable object An object whose value cannot change.

immutable data type A data type for which the value of any instance cannot change.

implementation A program that implements a set of methods defined in API, for use by a client.

import statement A Python statement that enables you to refer to code in another module.

instance An object of a particular class.

(instance) method The implementation of a data-type operation (a function that is invoked with respect to a particular object).

instance variable A variable defined inside a class (but outside any method) that represents a data-type value (data associated with each instance of the class).

interpreter A program that executes a program written in a high-level language, one line at a time.

item One of the objects in a collection.

iterable data type A data type that returns an iterator over its items, such as list, tuple, str, dict, and set.

iterator A data type that supports the built-in function next(), which Python calls at the beginning of each iteration of a for loop.

literal Source-code representation of a data-type value for built-in number and string types, such as 123, 'Hello', and True.

local variable A variable defined within a function, with scope limited to that function.

modular programming A style of programming that emphasizes using separate, independent modules to address a task.

module A .py file structured so that its features can be reused in other Python programs.

none object A special object None that represents no object.

object An in-computer-memory representation of a value from a particular data type, characterized by its identity, type, and value.

object-oriented programming A style of programming that emphasizes modeling real-world or abstract entities using data types and objects.

object reference A concrete representation of the object’s identity (the memory address where the object is stored).

operand An object on which an operator operates.

operating system The program on your computer that manages resources and provides common services for programs and applications.

operator A special symbol (or sequence of symbols) that represents a built-in data-type operation, such as +, -, *, and [].

overloading a function Defining the behavior of a built-in function—such as len(), max(), and abs()—for a data type.

overloading an operator Defining the behavior of an operator—such as +, *, <=, and []—for a data type.

parameter variable A variable specified in the definition of a function, initialized to the corresponding argument when the function is called.

pass by object reference Python’s style of passing an object to a function (by passing a reference to the object).

polymorphism Using the same API (or partial API) for different types of data.

precedence rules Rules that determine in which order the operators in an expression are applied.

private Data-type implementation code that is not to be referenced by clients.

program A sequence of instructions to be executed on a computer.

pure function A function that, given the same arguments, always returns the same value, without producing any observable side effect.

raise an error Signal a compile-time or run-time error.

return value The object (reference) provided as the result of a function call.

run-time error An error that occurs while the program is executing (an exception).

script A short program, usually implemented as global code and not intended for reuse.

scope The region of a program where a variable or name is directly accessible.

self parameter variable The first parameter variable in a method, which is bound to the object that calls the method. By convention, this variable is named self.

sequence An iterable data type which supports indexed access a[i] and len(a), such as list, str, and tuple (but not dict).

side effect A change in state, such as writing output, reading input, raising an error, or modifying the value of some persistent object (instance variable, parameter variable, or global variable).

slice A subsequence of an array, string, or other sequence.

source code A program or program fragment in a high-level programming language.

special method One of a set of built-in methods that Python calls implicitly when a corresponding data-type operation is invoked, such as __plus__(), __eq__(), and __len__().

standard input, output, drawing, and audio Our input/output modules for Python.

statement An instruction that Python can execute, such as an assignment statement, an if statement, a while statement, and a return statement.

terminal An application for your operating system that accepts commands.

unit testing The practice of including code in every module that tests the code in that module.

variable A container that stores a reference to an object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset