Glossary Flashcards

Words described in the glossary of python documentation

1
Q

> > >

A

The default Python prompt of the interactive shell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A

Either:

  1. The default Python prompt of the interactive shell when entering the code for an indented code block.
  2. The Ellipsis built-in constant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2to3

A

A tool that tries to convert Python 2.x code to Python 3.x code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

abstract base class

A

ABCs provide a blueprint for concrete classes. They don’t contain implementation. They instead provide an interface and make sure the derived concrete classes are properly implemented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

annotation

A

A label associated with a variable, a class attribute or a function parameter or return value, used by convention as a type hint.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

argument

A

A value passed to a function (or method) when calling the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

asynchronous context manager

A

An object which controls the environment seen in an async with statement by defining __aenter__() and __aexit__() methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

asynchronous generator

A

A function which returns an asynchronous generator iterator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

asynchronous generator iterator

A

An object created by an asynchronous generator function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

asynchronous iterable

A

An object that can be used in an async for statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

asynchronous iterator

A

An object that implements the __aiter__() and __anext__() methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

attribute

A

A value associated with an object which is reference by name using dotted expressions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

awaitable

A

An object that can be used in an await expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

BDFL

A

Benevolent Dictator For Life, a.k.a. Guido van Rossum, Python’s creator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

binary file

A

A file object able to read and write bytes-like objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

borrowed reference

A

In Python’s C API, a borrowed reference is a reference to an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

bytes-like object

A

An object that supports the Buffer Protocol and can export a C-contiguous buffer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

bytecode

A

Python source code is compiled into bytecode, the internal representation of a python program in the CPython interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

callback

A

A subroutine function which is passed as an argument to be executed at some point in the future.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

class

A

A template for creating user-defined objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

class variable

A

A variable defined in a class and intended to be modified only at a class level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

coercion

A

The implicit conversion of an instance of one type to another during an operation which involved two arguments of the same type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

complex number

A

An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

context manager

A

An object which controls the environment seen in a with statement by defining __enter__() and __exit__ () methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

context variable

A

A variable which can have different values depending on its context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

contiguous

A

A buffer is considered contiguous exactly if it is either C-contiguous or Fortran contiguous.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

coroutine

A

Coroutines are a more generalized form of subroutines. Subroutines are entered at one point and exited at another point. Coroutines can be entered exited, and resumed at many different points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

coroutine function

A

A function which returns a coroutine object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

CPython

A

The canonical implementation of the Python programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

decorator

A

A function returning another function, usually applied as a function transformation using the @wrapper syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

descriptor

A

Any object which defines the methods __get__(), __set__(), or __delete()__.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

dictionary

A

An associative array, where arbitrary keys are mapped to values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

dictionary comprehension

A

A compact way to process all or part of the elements in an iterable and return a dictionary with the results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

dictionary view

A

The objects returned from dict.keys(), dict.values(), and dict.items() are called dictionary views.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

docstring

A

A string literal which appears as the first expression in a class, function, or module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

duck-typing

A

A programming style which does not look at an object’s type to determine if it has the right interface; instead, the method or attribute is simply called or used (“if it looks like a duck and quacks like a duck, it must be a duck.”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

EAFP

A

Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

expression

A

A piece of syntax which can be evaluated to some value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

extension module

A

A module written in C or C++, using Python’s C API to interact with the core and with user code.

40
Q

f-string

A

String literals prefixed with ‘f’ or ‘F’ are commonly called “f-strings” which is short for formatted string literals.

41
Q

file object

A

An object exposing a file-oriented API.

42
Q

file-like object

A

a synonym for file object.

43
Q

filesystem encoding and error handler

A

Enoding and error handler used by Python to decode bytes from the operating system and encode Unicode to the operating system.

44
Q

finder

A

An object that tries to find the loader for a module that is being imported.

45
Q

floor division

A

Mathematical division that rounds down to nearest integer

46
Q

function

A

A series of statements which returns some value to a caller.

47
Q

function annotation

A

An annotation of a function parameter or return value.

48
Q

__future__

A

A future statement that directs the compiler to compile the current module using syntax or semantics that will become standard in a future release of Python.

49
Q

garbage collection

A

The process of freeing memory when it is not used anymore.

50
Q

generator

A

A function which returns a generator iterator

51
Q

generator iterator

A

An object created by a generator function.

52
Q

generator expression

A

An expression that returns an iterator.

53
Q

Generic function

A

A function composed of multiple functions implementing the same operation for different types.

54
Q

generic type

A

A type that can be parameterized; typically a container class such as list or dict.

55
Q

global interpreter lock (GIL)

A

The mechanism used by the CPython interpreter to assure that only one thread executes Python bytecode at a time.

56
Q

hash-based pyc

A

A bytecode cache file that uses the hash rather than the last-modified time of the corresponding source file to determine its validity.

57
Q

hashable

A

An object is hashable if it has a hash value which never changes during its lifetime and can be compared to other objects.

58
Q

IDLE

A

An Integrated Development Environment for Python that ships with Python.

59
Q

Immutable

A

An object with a fixed value.

60
Q

Import path

A

A list of locations that are searched by the path based finder for modules to import.

61
Q

importing

A

The process by which Python code in one module is made available to Python code in another module.

62
Q

importer

A

An object that both finds and loads a module; both a finder and loader object.

63
Q

interactive

A

Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately execute them and see their results.

64
Q

Interpreted

A

The source files can be run directly without explicitly creating an executable which is then run.
Python is an interpreted language, as opposed to a compiled one.

65
Q

interpreter shutdown

A

When asked to shut down, the Python interpreter enters a special phase where it gradually releases all allocated resources, such as modules and various critical internal structures.

66
Q

Iterable

A

An object capable of returning its members one at a time.

67
Q

iterator

A

An object representing a stream of data.

68
Q

key function

A

A key function or collation function is a callable that returns a value used for sorting or ordering.

69
Q

lambda

A

An anonymous inline function consisting of a single expression which is evaluated when the function is called.

70
Q

LBYL

A

Look before you leap.

This coding style explicitly tests for pre-conditions before making calls or lookups.

71
Q

list

A

A built-in Python sequence

72
Q

list comprehension

A

A compact way to process all or part of the elements in a sequence and return a list with the results.

73
Q

loader

A

An object that loads a module.

74
Q

magic method

A

An informal synonym for “special method.”

75
Q

mapping

A

A container object that supports arbitrary key lookups and implements the methods specified in the Mapping or MutableMapping abstract base classes.

76
Q

meta path finder

A

A finder returned by a search of sys.meta_path.

77
Q

metaclass

A

The class of a class.

78
Q

method

A

A function which is defined inside a class body.

79
Q

method resolution order (MRO)

A

Method resolution order is the order in which base classes are searched for a member during lookup.

80
Q

module

A

An object that serves as an organizational unit of Python code.

81
Q

module spec

A

A namespace containing the import-related information used to load a module.

82
Q

mutable

A

Mutable objects can change their value but keep their id().

83
Q

named tuple

A

The term “named tuple” applies to any type or class that inherits from typle and whose indexable elements are also accessible using named attributes.

84
Q

namespace

A

The place where a variable is stored.

85
Q

namespace package

A

A PEP 420 package which serves only as a container for subpackages.

86
Q

nested scope

A

The ability to refer to a variable in an enclosing definition.

87
Q

new-style class

A

Old name for the flavor of classes now used for all class objects.

88
Q

object

A

Any data with state (attributes or value) and defined behavior (methods).

89
Q

package

A

A Python module which can contain submodules or recursively, subpackages.

90
Q

parameter

A
A named entity in a function (or method) definition that specifies an argument (or in some cases, arguments) that the function can accept. There are five types of parameter:
positional-or-keyword
positional-only
keyword-only
var-positional
var-keyword
91
Q

path entry

A

A single location on the import path which the path based finder consults to find modules for importing.

92
Q

path entry finder

A

A finder returned by a callable on sys.path_hooks which knows how to locate modules given a path entry.

93
Q

path entry hook

A

A callable on the sys.path_hook list which returns a path entry finder if it knows how to find modules on a specific path entry.

94
Q

path based finder

A

One of the default meta path finders which searches an import path for modules.

95
Q

path-like object

A

An object representing a file system path.

96
Q

PEP

A

Python Enhancement Proposal.
A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment.