Glossário Consolidado¶
Este glossário é a união de todos os glossários dos capítulos. Cada entrada está vinculada ao capítulo onde ela aparece, por exemplo: bug [1].
Note que alguns termos aparecem em mais de um capítulo, às vezes com definições diferentes, de acordo com o contexto.
- acumulador (accumulator) [10]
- A variable used in a loop to add up or accumulate a result.
- algoritmo (algorithm) [7]
- A general process for solving a category of problems.
- aliasing (“apelidamento”) [10]
- A circumstance where two or more variables refer to the same object.
- analisar (parse) [1]
- To examine a program and analyze the syntactic structure.
- análise de algoritmos (analysis of algorithms) [B]
- A way to compare algorithms in terms of their run time and/or space requirements.
- argumento nomeado (keyword argument) [4]
- An argument that includes the name of the parameter as a “keyword”.
- argumento opcional (optional argument) [8]
- A function or method argument that is not required.
- argumento posicional (positional argument) [17]
- An argument that does not include a parameter name, so it is not a keyword argument.
- argumento (argument) [3]
- A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.
- arquivo-texto (text file) [14]
- A sequence of characters stored in permanent storage like a hard drive.
assert
, instrução (assert
statement) [16]- A statement that check a condition and raises an exception if it fails.
- assinatura (interface) [4]
- A description of how to use a function, including the name and descriptions of the arguments and return value.
- atribuição combinada (augmented assignment) [10]
- A statement that updates the value of a variable using an operator like
+=
. - atribuição (assignment) [2]
- A statement that assigns a value to a variable.
- atributo de classe (class attribute) [18]
- An attribute associated with a class object. Class attributes are defined inside a class definition but outside any method.
- atributo de instância (instance attribute) [18]
- An attribute associated with an instance of a class.
- atributo (attribute) [15]
- One of the named values associated with an object.
- atualização (update) [7]
- An assignment where the new value of the variable depends on the old.
- avaliar (evaluate) [2]
- To simplify an expression by performing the operations in order to yield a single value.
- banco de dados (database) [14]
- A file whose contents are organized like a dictionary with keys that correspond to values.
- bug [1]
- An error in a program.
- busca invertida (reverse lookup) [11]
- A dictionary operation that takes a value and finds one or more keys that map to it.
- busca (search) [8]
- A pattern of traversal that stops when it finds what it is looking for.
- busca (lookup) [11]
- A dictionary operation that takes a key and finds the corresponding value.
- busca (search) [B]
- The problem of locating an element of a collection (like a list or dictionary) or determining that it is not present.
- cabeçalho (header) [3]
- The first line of a function definition.
- caminho absoluto (absolute path) [14]
- A path that starts from the topmost directory in the file system.
- caminho relativo (relative path) [14]
- A path that starts from the current directory.
- caminho (path) [14]
- A string that identifies a file.
- capturar (catch) [14]
- To prevent an exception from terminating a program using the try and except statements.
- cardinalidade (multiplicity) [18]
- A notation in a class diagram that shows, for a HAS-A relationship, how many references there are to instances of another class.
- caso base (base case) [5]
- A conditional branch in a recursive function that does not make a recursive call.
- caso especial (special case) [9]
- A test case that is atypical or non-obvious (and less likely to be handled correctly).
- chamada de função (function call) [3]
- A statement that runs a function. It consists of the function name followed by an argument list in parentheses.
- chave (key) [11]
- An object that appears in a dictionary as the first part of a key-value pair.
- classe base (parent class) [18]
- The class from which a child class inherits.
- classe derivada (child class) [18]
- A new class created by inheriting from an existing class; also called a “subclass”.
- classe (class) [15]
- A programmer-defined type. A class definition creates a new class object.
- codificar (encode) [18]
- To represent one set of values using another set of values by constructing a mapping between them.
- código morto (dead code) [6]
- Part of a program that can never run, often because it appears after a return statement.
- código provisório (scaffolding) [6]
- Code that is used during program development but is not part of the final version.
- código provisório (slice) [8]
- A part of a string specified by a range of indices.
- comentário (comment) [2]
- Information in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program.
- composição (composition) [3]
- Using an expression as part of a larger expression, or a statement as part of a larger statement.
- concatenar (concatenate) [2]
- To join two operands end-to-end.
- condição (condition) [5]
- The boolean expression in a conditional statement that determines which branch runs.
- condicional aninhado (nested conditional) [5]
- A conditional statement that appears in one of the branches of another conditional statement.
- condicional encadeado (chained conditional) [5]
- A conditional statement with a series of alternative branches.
- contador (counter) [8]
- A variable used to count something, usually initialized to zero and then incremented.
- cópia profunda (deep copy) [15]
- To copy the contents of an object as well as any embedded objects, and any objects embedded in them, and so on; implemented by the deepcopy function in the copy module.
- cópia rasa (shallow copy) [15]
- To copy the contents of an object, including any references to embedded objects; implemented by the copy function in the copy module.
- corpo (body) [3]
- The sequence of statements inside a function definition.
- declaração (declaration) [11]
- A statement like global that tells the interpreter something about a variable.
- decrementar (decrement) [7]
- An update that decreases the value of a variable.
- definição de função (function definition) [3]
- A statement that creates a new function, specifying its name, parameters, and the statements it contains.
- delimitador (delimiter) [10]
- A character or string used to indicate where a string should be split.
- dependência (dependency) [18]
- A relationship between two classes where instances of one class use instances of the other class, but do not store them as attributes.
- depuração com patinho de borracha (rubber duck debugging) [13]
- Debugging by explaining your problem to an inanimate object such as a rubber duck. Articulating the problem can help you solve it, even if the rubber duck doesn’t know Python.
- depuração (debugging) [1]
- The process of finding and correcting bugs.
- desempacotamento de tupla (tuple assignment) [12]
- An assignment with a sequence on the right side and a tuple of variables on the left. The right side is evaluated and then its elements are assigned to the variables on the left.
- desenvolvimento incremental (incremental development) [6]
- A program development plan intended to avoid debugging by adding and testing only a small amount of code at a time.
- desenvolvimento planejado (designed development) [16]
- A development plan that involves high-level insight into the problem and more planning than incremental development or prototype development.
- despacho por tipo (type-based dispatch) [17]
- A programming pattern that checks the type of an operand and invokes different functions for different types.
- desvio (branch) [5]
- One of the alternative sequences of statements in a conditional statement.
- determinístico (deterministic) [13]
- Pertaining to a program that does the same thing each time it runs, given the same inputs.
- diagrama de chamadas (call graph) [11]
- A diagram that shows every frame created during the execution of a program, with an arrow from each caller to each callee.
- diagrama de classe (class diagram) [18]
- A diagram that shows the classes in a program and the relationships between them.
- diagrama de estado (state diagram) [2]
- A graphical representation of a set of variables and the values they refer to.
- diagrama de objetos (object diagram) [15]
- A diagram that shows objects, their attributes, and the values of the attributes.
- diagrama de pilha (stack diagram) [3]
- A graphical representation of a stack of functions, their variables, and the values they refer to.
- dicionário (dictionary) [11]
- A mapping from keys to their corresponding values.
- diretório (directory) [14]
- A named collection of files, also called a folder.
- divisão pelo piso (floor division) [5]
- An operator, denoted //, that divides two numbers and rounds down (toward zero) to an integer.
- docstring [4]
- A string that appears at the top of a function definition to document the function’s interface.
- elemento (element) [10]
- One of the values in a list (or other sequence), also called items.
- encapsulamento de dados (data encapsulation) [18]
- A program development plan that involves a prototype using global variables and a final version that makes the global variables into instance attributes.
- encapsulamento (encapsulation) [4]
- The process of transforming a sequence of statements into a function definition.
- equivalente (equivalent) [10]
- Having the same value.
- erro semântico (semantic error) [2]
- An error in a program that makes it do something other than what the programmer intended.
- erro sintático (syntax error) [2]
- An error in a program that makes it impossible to parse (and therefore impossible to interpret).
- errro estrutural (shape error) [12]
- An error caused because a value has the wrong shape; that is, the wrong type or size.
- estrutura de dados (data structure) [12]
- A collection of related values, often organized in lists, dictionaries, tuples, etc.
- exceção (exception) [2]
- An error that is detected while the program is running.
- executar (execute) [2]
- To run a statement and do what it says.
- explodir (scatter) [12]
- The operation of treating a sequence as a list of arguments.
- expressão booleana (boolean expression) [5]
- An expression whose value is either True or False.
- expressão condicional (conditional expression) [19]
- An expression that has one of two values, depending on a condition.
- expressão geradora (generator expression) [19]
- An expression with a for loop in parentheses that yields a generator object.
- expressão (expression) [2]
- A combination of variables, operators, and values that represents a single result.
- fachada (veneer) [18]
- A method or function that provides a different interface to another function without doing much computation.
- factory (fábrica) [19]
- A function, usually passed as a parameter, used to create objects.
- filtro (filter) [10]
- A processing pattern that traverses a list and selects the elements that satisfy some criterion.
- flag (“indicador”) [11]
- A boolean variable used to indicate whether a condition is true.
- fluxo de execução (flow of execution) [3]
- The order statements run in.
- frame () [3]
- A box in a stack diagram that represents a function call. It contains the local variables and parameters of the function.
- função de hash (hash function) [11]
- A function used by a hashtable to compute the location for a key.
- função produtiva (fruitful function) [3]
- A function that returns a value.
- função pura (pure function) [16]
- A function that does not modify any of the objects it receives as arguments. Most pure functions are fruitful.
- função (function) [3]
- A named sequence of statements that performs some useful operation. Functions may or may not take arguments and may or may not produce a result.
- generalização (generalization) [4]
- The process of replacing something unnecessarily specific (like a number) with something appropriately general (like a variable or parameter).
global
, declaração (global
statement) [11]- A statement that declares a variable name global.
- guarda (guardian) [6]
- A programming pattern that uses a conditional statement to check for and handle circumstances that might cause an error.
- hashable () [11]
- A type that has a hash function. Immutable types like integers, floats and strings are hashable; mutable types like lists and dictionaries are not.
- herança (inheritance) [18]
- The ability to define a new class that is a modified version of a previously defined class.
- idêntico (identical) [10]
- Being the same object (which implies equivalence).
- implementação (implementation) [11]
- A way of performing a computation.
import
, instrução (import
statement) [3]- A statement that reads a module file and creates a module object.
- imutável (immutable) [8]
- The property of a sequence whose items cannot be changed.
- incrementar (increment) [7]
- An update that increases the value of a variable (often by one).
- índice (index) [8]
- An integer value used to select an item in a sequence, such as a character in a string. In Python indices start from 0.
- inicialização (initialization) [7]
- An assignment that gives an initial value to a variable that will be updated.
- instanciar (instantiate) [15]
- To create a new object.
- instância (instance) [15]
- An object that belongs to a class.
- instrução composta (compound statement) [5]
- A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.
- instrução condicional (conditional statement) [5]
- A statement that controls the flow of execution depending on some condition.
- instrução (statement) [2]
- A section of code that represents a command or action. So far, the statements we have seen are assignments and print statements.
- inteiro (integer) [1]
- A type that represents whole numbers.
- interpretador (interpreter) [1]
- A program that reads another program and executes it
- invariante (invariant) [16]
- A condition that should always be true during the execution of a program.
- invocação (invocation) [8]
- A statement that calls a method.
- item (item) [8]
- One of the values in a sequence.
- item (item) [11]
- In a dictionary, another name for a key-value pair.
- iteração (iteration) [7]
- Repeated execution of a set of statements using either a recursive function call or a loop.
- iterador (iterator) [12]
- An object that can iterate through a sequence, but which does not provide list operators and methods.
- laço infinito (infinite loop) [7]
- A loop in which the terminating condition is never satisfied.
- laço (loop) [4]
- A part of a program that can run repeatedly.
- linear (linear) [B]
- An algorithm whose run time is proportional to problem size, at least for large problem sizes.
- linguagem de alto nível (high-level language) [1]
- A programming language like Python that is designed to be easy for humans to read and write.
- linguagem de baixo nível (low-level language) [1]
- A programming language that is designed to be easy for a computer to run; also called “machine language” or “assembly language”.
- linguagem formal (formal language) [1]
- Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs; all programming languages are formal languages.
- linguagem natural (natural language) [1]
- Any one of the languages that people speak that evolved naturally.
- linguagem orientada a objetos (object-oriented language) [17]
- A language that provides features, such as programmer-defined types and methods, that facilitate object-oriented programming.
- lista aninhada (nested list) [10]
- A list that is an element of another list.
- lista (list) [10]
- A sequence of values.
- listcomp (list comprehension) [19]
- An expression with a for loop in square brackets that yields a new list.
- mapeamento (mapping) [11]
- A relationship in which each element of one set corresponds to an element of another set.
- map (“mapear”, “de-para”) [10]
- A processing pattern that traverses a sequence and performs an operation on each element.
- máquina-modelo (machine model) [B]
- A simplified representation of a computer used to describe algorithms.
- memo (“lembrete”) [11]
- A computed value stored to avoid unnecessary future computation.
- método (method) [4]
- A function that is associated with an object and called using dot notation.
- método (method) [17]
- A function that is defined inside a class definition and is invoked on instances of that class.
- modificadora (modifier) [16]
- A function that changes one or more of the objects it receives as arguments. Most modifiers are void; that is, they return None.
- modo de script (script mode) [2]
- A way of using the Python interpreter to read code from a script and run it.
- modo interativo (interactive mode) [2]
- A way of using the Python interpreter by typing code at the prompt.
- módulo (module) [3]
- A file that contains a collection of related functions and other definitions.
- multiset (“multi-conjunto”) [19]
- A mathematical entity that represents a mapping between the elements of a set and the number of times they appear.
None
[3]- A special value returned by void functions.
- notação assintótica (Big-Oh notation) [B]
- Notation for representing an order of growth; for example, O(n) represents the set of functions that grow linearly.
- notação de ponto (dot notation) [3]
- The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.
- objeto-arquivo (file object) [9]
- A value that represents an open file.
- objeto
bytes
(bytes
object) [14] - An object similar to a string.
- objeto-classe (class object) [15]
- An object that contains information about a programmer-defined type. The class object can be used to create instances of the type.
- objeto embutido (embedded object) [15]
- An object that is stored as an attribute of another object.
- objeto-função (function object) [3]
- A value created by a function definition. The name of the function is a variable that refers to a function object.
- objeto-módulo (module object) [3]
- A value created by an import statement that provides access to the values defined in a module.
- objeto “pipe” (pipe object) [14]
- An object that represents a running program, allowing a Python program to run commands and read the results.
- objeto
zip
(zip
object) [12] - The result of calling a built-in function zip; an object that iterates through a sequence of tuples.
- objeto (object) [8]
- Something a variable can refer to. For now, you can use “object” and “value” interchangeably.
- objeto (object) [10]
- Something a variable can refer to. An object has a type and a value.
- ocultação de informações (information hiding) [17]
- The principle that the interface provided by an object should not depend on its implementation, in particular the representation of its attributes.
- operador de formatação (format operator) [14]
- An operator, %, that takes a format string and a tuple and generates a string that includes the elements of the tuple formatted as specified by the format string.
- operador de módulo (modulus operator) [5]
- An operator, denoted with a percent sign (%), that works on integers and returns the remainder when one number is divided by another.
- operador lógico (logical operator) [5]
- One of the operators that combines boolean expressions: and, or, and not.
- operador relacional (relational operator) [5]
- One of the operators that compares its operands: ==, !=, >, <, >=, and <=.
- operador (operator) [1]
- A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
- operando (operand) [2]
- One of the values on which an operator operates.
- ordem das operações (order of operations) [2]
- Rules governing the order in which expressions involving multiple operators and operands are evaluated.
- ordem de crescimento (order of growth) [B]
- A set of functions that all grow in a way considered equivalent for purposes of analysis of algorithms. For example, all functions that grow linearly belong to the same order of growth.
- palavra-chave (keyword) [2]
- A reserved word that is used to parse a program; you cannot use keywords like if, def, and while as variable names.
- parâmetro (parameter) [3]
- A name used inside a function to refer to the value passed as an argument.
- par chave-valor (key-value pair) [11]
- The representation of the mapping from a key to a value.
- percorrer (traverse) [8]
- To iterate through the items in a sequence, performing a similar operation on each.
- persistente (persistent) [14]
- Pertaining to a program that runs indefinitely and keeps at least some of its data in permanent storage.
- pior caso (worst case) [B]
- The input that makes a given algorithm run slowest (or require the most space.
- plano de desenvolvimento (development plan) [4]
- A process for writing programs.
- polimórfico (polymorphic) [17]
- Pertaining to a function that can work with more than one type.
- ponto de cruzamento (crossover point) [B]
- The problem size where two algorithms require the same run time or space.
- ponto-flutuante (floating-point) [1]
- A type that represents numbers with fractional parts.
- portabilidade (portability) [1]
- A property of a program that can run on more than one kind of computer.
- pós-condição (postcondition) [4]
- A requirement that should be satisfied by the function before it ends.
- pré-condição (precondition) [4]
- A requirement that should be satisfied by the caller before a function starts.
print
, instrução (print
statement) [1]- An instruction that causes the Python interpreter to display a value on the screen.
- procedimento (void function) [3]
- A function that always returns None.
- programação funcional (program) [1]
- A set of instructions that specifies a computation.
- programação funcional (functional programming style) [16]
- A style of program design in which the majority of functions are pure.
- programação orientada a objetos (object-oriented programming) [17]
- A style of programming in which data and the operations that manipulate it are organized into classes and methods.
- prompt (“sinal de pronto”) [1]
- Characters displayed by the interpreter to indicate that it is ready to take input from the user.
- prototipar e ajustar (prototype and patch) [16]
- A development plan that involves writing a rough draft of a program, testing, and correcting errors as they are found.
- pseudo-aleatório (pseudorandom) [13]
- Pertaining to a sequence of numbers that appears to be random, but is generated by a deterministic program.
- quadrático (quadratic) [B]
- An algorithm whose run time is proportional to n^2, where n is a measure of problem size.
raise
, instrução (raise
statement) [11]- A statement that (deliberately) raises an exception.
- reatribuição (reassignment) [7]
- Assigning a new value to a variable that already exists.
- recursão infinita (infinite recursion) [5]
- A recursion that doesn’t have a base case, or never reaches it. Eventually, an infinite recursion causes a runtime error.
- recursão (recursion) [5]
- The process of calling the function that is currently executing.
- redução a um problema resolvido (reduction to a previously solved problem) [9]
- A way of solving a problem by expressing it as an instance of a previously solved problem.
- reduzir (reduce) [10]
- A processing pattern that traverses a sequence and accumulates the elements into a single result.
- refatoração (refactoring) [4]
- The process of modifying a working program to improve function interfaces and other qualities of the code.
- referência (reference) [10]
- The association between a variable and its value.
- relação É-UM (IS-A relationship) [18]
- A relationship between a child class and its parent class.
- relação TEM-UM (HAS-A relationship) [18]
- A relationship between two classes where instances of one class contain references to instances of the other.
return
, instrução (return
statement) [5]- A statement that causes a function to end immediately and return to the caller.
- reunir (gather) [12]
- The operation of assembling a variable-length argument tuple.
- script [2]
- A program stored in a file.
- semântica (semantics) [2]
- The meaning of a program.
- sequência de formatação (sequence) [8]
- An ordered collection of values where each value is identified by an integer index.
- sequência de formatação (format sequence) [14]
- A sequence of characters in a format string, like %d, that specifies how a value should be formatted.
- shell [14]
- A program that allows users to type commands and then executes them by starting other programs.
- singleton [11]
- A list (or other sequence) with a single element.
- sintaxe (syntax) [1]
- The rules that govern the structure of a program.
- sobrecarga de operadores (operator overloading) [17]
- Changing the behavior of an operator like + so it works with a programmer-defined type.
- sobrepor (override) [13]
- To replace a default value with an argument.
- solução de problemas (problem solving) [1]
- The process of formulating a problem, finding a solution, and expressing it.
- string de formatação (format string) [14]
- A string, used with the format operator, that contains format sequences.
- string vazia (empty string) [8]
- A string with no characters and length 0, represented by two quotation marks.
- string (“cadeia de caracteres”) [1]
- A type that represents sequences of characters.
- sujeito (subject) [17]
- The object a method is invoked on.
- tabela de hash (hashtable) [11]
- The algorithm used to implement Python dictionaries.
- tabela de hash (hashtable) [B]
- A data structure that represents a collection of key-value pairs and performs search in constant time.
- termo dominante (leading term) [B]
- In a polynomial, the term with the highest exponent.
- teste de desempenho (benchmarking) [13]
- The process of choosing between data structures by implementing alternatives and testing them on a sample of the possible inputs.
- tipo (type) [1]
- A category of values. The types we have seen so far are integers (type int), floating-point numbers (type float), and strings (type str).
- token (“símbolo”) [1]
- One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.
- traceback () [3]
- A list of the functions that are executing, printed when an exception occurs.
- tupla (tuple) [12]
- An immutable sequence of elements.
- valor default (default value) [13]
- The value given to an optional parameter if no argument is provided.
- valor devolvido (return value) [3]
- The result of a function. If a function call is used as an expression, the return value is the value of the expression.
- valor (value) [1]
- One of the basic units of data, like a number or string, that a program manipulates.
- valor (value) [11]
- An object that appears in a dictionary as the second part of a key-value pair. This is more specific than our previous use of the word “value”.
- variável global (global variable) [11]
- A variable defined outside a function. Global variables can be accessed from any function.
- variável local (local variable) [3]
- A variable defined inside a function. A local variable can only be used inside its function.
- variável temporária (temporary variable) [6]
- A variable used to store an intermediate value in a complex calculation.
- variável (variable) [2]
- A name that refers to a value.