The Python Glossary is a comprehensive collection of common Python concepts and terms. It serves as a quick reference for both beginners and experienced developers seeking concise definitions and refreshers on Python’s features.
Not sure which term you need? Describe what you’re trying to do, and Mentor AI will point you to the right entries.
absolute importAn absolute import uses a module’s full path from your project’s top-level package.
abstract base class (ABC)A class that is meant to be used as a blueprint for other classes. It provides the expected public interface to implement in concrete derived classes.
abstract methodA method that is marked with @abstractmethod.
annotationA way to attach metadata to function arguments, return values, and variables.
args (arguments)A special syntax that allows a function to accept an undefined number of positional arguments.
argumentA value or object that you pass into a function or method when you call it.
arrayA data structure that holds a sequence of objects of the same data type.
ASCIIASCII (American Standard Code for Information Interchange) is a 7-bit character encoding standard that represents 128 characters, including English letters, digits, punctuation marks, and control characters.
assertionA debugging aid that tests a condition as an internal self-check.
assignmentAn operation that allows you to attach values to variables.
asynchronous iterationA powerful feature that allows you to iterate over asynchronous iterators with an async for loop.
asynchronous iteratorAn object that allows you to traverse asynchronous iterables using async for loops.
asynchronous programmingA programming paradigm where you write code that can handle multiple tasks concurrently without blocking the execution of your program.
attributeA value associated with an object that can be accessed using dot notation.
awaitableAn object that you can pause the execution of a coroutine and wait for the object to complete before resuming the coroutine.
base classA base class, also known as a superclass or parent class, is a class from which other classes inherit attributes (data) and behaviors (methods).
BDFLBenevolent Dictator For Life, a.k.a. Guido van Rossum, Python’s creator.
binary fileA type of computer file that stores data in binary format.
BooleanA fundamental data type that can have only one of two values: true or false.
Boolean flagA variable or function parameter that you set to either True or False.
buffer protocolA mechanism in Python that allows objects to share their internal memory buffers with other objects for direct access.
bytecodeA low-level set of instructions that is portable across different platforms, which means it can be executed on any machine that has a compatible CPython interpreter.
bytes-like objectAny object that supports the buffer protocol, exposing its underlying binary data efficiently to other objects.
callableAn object that you can call like a function.
callbackA function that you pass as an argument to another function that later calls the callback.
camel caseA naming convention where words are written without spaces, with word boundaries marked by uppercase letters. The first letter may be lowercase (lowerCamelCase) or uppercase (UpperCamelCase, also called Pascal case).
classA blueprint for creating objects. It defines attributes as variables and implements behaviors as methods.
class methodA method that belongs to the class rather than to any specific instance of the class.
closureA function object that has access to variables in its enclosing (containing) lexical scope, even when the function is called outside that scope.
cls (argument)A conventional name for the first argument of a class method.
code styleGuidelines for writing code in a clear, standardized way that makes it easy to read, understand, and maintain
collectionA container data structure that stores and organizes multiple items, including built-ins like lists, dictionaries, sets, and tuples.
command-line interface (CLI)A text-based method of interacting with a program by typing commands into a terminal or console.
commentExplanatory text that Python ignores when executing code.
compositionA fundamental concept in object-oriented programming (OOP) that allows you to build composite objects by combining simpler ones.
comprehensionA concise Python syntax for creating lists, dictionaries, sets, and generator iterators.
concatenationThe operation of joining two or more strings end-to-end to create a new string.
concurrencyThe ability of a program to manage multiple tasks simultaneously.
consoleThe text-based interface used for interacting with your computer’s operating system and running Python programs.
context managerAn object that allows you to handle a context where you allocate and release resources as needed.
control flowThe order in which individual statements are executed or evaluated within a Python program.
coroutineAn object representing a computation that can be paused and resumed.
coroutine functionA function defined with the async def syntax that returns coroutine objects, which can pause their execution and yield control back to the event loop.
CPU-bound taskA task whose execution speed is primarily limited by the speed of the central processing unit (CPU).
CPythonThe reference and official implementation of the Python programming language.
data classA special type of class that is mainly used to store data.
DataFrameA data structure for working with tabular data in Python.
data structureA way of organizing and storing data so that you can access and modify it efficiently.
debuggingThe process of identifying, analyzing, and removing errors or bugs from your code.
decoratorA callable that takes another callable as an argument and modifies its behavior without modifying its implementation, returning a new callable.
deep copyA new object that is a complete, independent clone of the original object.
dependencyAn external package that your project needs in order to run, build, or be developed.
descriptorAn object that controls an attribute’s behavior when you access, modify, or delete it.
dictionaryA built-in data type that allows you to store a collection of key-value pairs.
dictionary viewAn object that provides a dynamic view of dictionary keys, values, or items.
docstringA string literal that occurs as the first statement in a module, function, class, or method definition and works as documentation.
dot notationA syntax that allows you to access attributes and methods of objects.
duck typingA programming style where an object is considered compatible with a given type if it has all the methods and attributes that the type requires.
escape sequenceA series of characters that represents a special character or action inside a string or bytes literal.
exceptionAn event that interrupts normal program flow in Python, often due to errors or special conditions.
exploratory data analysis (EDA)An approach to analyzing a dataset that uses summary statistics and plots to reveal its structure, gaps, and outliers before formal modeling.
expressionA combination of values, variables, operators, and function calls that can be evaluated to produce a value.
f-stringA string literal that allows you to interpolate expressions inside strings using curly braces, to produce a formatted string.
functionA self-contained block of code that performs a specific task.
functional programming (FP)A programming paradigm that emphasizes pure functions, immutable data, and function composition.
function annotationA way to attach type information or type hints to function parameters and return values.
garbage collectionAn automatic memory management feature that reclaims memory occupied by objects no longer used by your program.
generatorA function that returns a generator iterator, which yields data items on demand, making it memory efficient.
generator expressionAn expression that constructs a generator iterator without the need for a function.
generator iteratorAn iterator that results from calling a generator function or evaluating a generator expression, letting you iterate over a data stream one item at a time.
generic functionA function composed of multiple implementations of the same operation for different types, where a dispatch algorithm picks the implementation to run.
generic typeA type that you can parameterize with other types.
Global Interpreter Lock (GIL)A lock used in the CPython implementation to ensure that only one thread executes Python bytecode at a time.
global variableA variable defined at the top level of a module.
graphical user interface (GUI)A visual way of interacting with a program through windows, buttons, and other on-screen elements.
Guido van RossumThe Dutch programmer who created Python and served as its benevolent dictator for life until 2018.
hashableAn object with a hash value that remains constant during the object’s lifetime.
helper functionA small function that handles one focused subtask on behalf of other code, keeping the calling function short and readable.
higher-order functionA function that either takes one or more functions as arguments or returns a function as its result.
identifierA name that identifies a variable, function, class, module, or other object.
IDLEA lightweight integrated development environment (IDE) that ships with most Python installations.
immutableAn object whose value can’t be modified after it’s created.
import pathThe path that Python searches to find the modules that you want to import into your code.
indentationThe use of spaces or tabs at the beginning of a line of code to visually separate and group code blocks.
indexingAn operation that allows you to access individual items within a sequence.
inheritanceA fundamental object-oriented concept that allows you to create a new class by extending an existing one.
input/output (I/O)The mechanisms that facilitate communication between a computer program and the outside world.
interpreterThe program that reads and executes Python code.
interpreter shutdownA process that occurs when the Python interpreter terminates, cleaning up resources by closing open files, releasing memory, and calling object destructors.
introspectionThe ability of a program to examine the type or properties of an object at runtime.
I/O-bound taskA type of computing task that primarily spends its time waiting for input/output (I/O) operations to complete.
iterableAn object that can return its elements one at a time, allowing you to loop over it using a for loop or any other iteration tool.
iterationThe process of repeatedly accessing the items of an iterable, such as a sequence or collection, one at a time.
iteratorAn object that adheres to the iterator protocol and allows you to iterate through all the elements in a data stream.
JavaScript Object Notation (JSON)A lightweight, text-based data interchange format that’s easy for humans to read and write, and easy for machines to parse and generate.
JIT compilerA part of the runtime environment for Python that compiles bytecode into machine code at runtime.
kwargs (keyword arguments)A special syntax for defining functions that accept an undetermined number of keyword arguments.
LBYLA coding style that emphasizes checking for conditions before executing a particular action.
linterA static code analysis tool that examines source code to flag potential errors, bugs, stylistic issues, and suspicious constructs.
literalA notation used to represent a fixed value in your code.
loaderA mechanism responsible for loading a module or package’s code into a Python runtime environment.
local variableA variable that you bind inside a function or method body.
loopA programming construct that allows you to repeat a block of code multiple times.
magic methodA method that allows you to define how objects behave with built-in functions and operators.
magic numberAn unnamed numeric literal in your source code that gives no hint of what the value means.
mappingA data structure that associates keys with values.
metaprogrammingThe practice of writing code that manipulates or generates other code.
methodA function that is associated with a particular object or class.
method overridingRedefining a method in a subclass when that method has already been defined in the base class.
mockingA testing technique that replaces real objects with controllable stand-ins so you can isolate code under test and verify how it uses dependencies.
moduleA file containing Python code, which can define functions, classes, variables, and more.
mutableAn object that allows you to modify its value in place without creating a new object.
named tupleA variation of the built-in tuple data type that allows you to create tuple-like objects with items that have descriptive names.
name manglingA mechanism that protects class and instance attributes from being accidentally overridden or accessed from outside the class.
namespaceA container that holds a collection of identifiers, such as variable and function names, and their corresponding objects.
namespace packageA type of package that allows you to split a single package across multiple directories.
nested scopeA scope that is defined within another and has the ability to refer to a variable in an enclosing scope.
non-blocking operationAn operation or task that allows your program to continue executing other tasks without waiting for the operation to complete.
non-public nameThe name of a variable, function, method, or attribute that’s intended for internal use within a module or a class.
objectA piece of data in memory that has attributes (data) and methods (behaviors).
operator precedenceA set of rules that decides which operators Python evaluates first when an expression contains several of them.
packageA directory hierarchy that allows you to organize related modules and subpackages.
parameterA variable that you use in a function or method definition to accept input values.
PEP 8Python’s official style guide outlining coding conventions for writing clear, readable code that’s consistent with the core Python codebase.
pipPython’s default package installer and dependency manager.
polymorphismA concept in object-oriented programming (OOP) that allows objects of different classes to be treated the same if they share the same interface.
protocolA set of methods and attributes that a class must implement to support specific behavior or functionality.
protocol (special methods)A series of special methods and attributes that a class must implement to support specific behavior or functionality.
protocol (subtyping)A series of methods and attributes that a class must implement to be considered of a given type.
public nameAny attribute, method, or variable within a module, class, or object that is intended to be used from outside its immediate scope.
PyConPython programming conferences organized by local communities worldwide.
pyproject.tomlA configuration file at the root of a Python project that declares its build system, metadata, and dependencies in TOML format.
PyPyAn alternative implementation of Python that uses a just-in-time compiler to run pure-Python code faster than CPython.
PythonA high-level, interpreted programming language with a clean and straightforward syntax.
Python Enhancement Proposal (PEP)A design document that provides information to the Python community or proposes changes to Python itself.
PythonicAn approach or style of writing code that aligns with Python’s philosophy and idioms.
pythonistaA Python programmer who uses the language regularly and enthusiastically, writes Pythonic code, and takes part in the Python community.
python.orgThe official website for the Python programming language.
Python Steering CouncilA small group elected to oversee the development and direction of the Python programming language.
queueA data structure that follows the First-In-First-Out (FIFO) principle.
raw stringA string that treats backslashes (``) as literal characters without their usual special meaning in escape sequences.
recursionA programming technique that consists of a function calling itself in order to solve a problem.
reference countA mechanism used by the interpreter to manage memory allocation and deallocation for objects.
relative importImport modules from the same package or parent packages using leading dots.
release candidateA pre-release version of Python that becomes the final release unless critical bugs are found in testing.
REPLAn interactive programming environment that allows you to write and execute code in a step-by-step manner and get immediate feedback on how the code works.
requirements.txtA plain text file that lists the packages a project needs, so pip can install them all with a single command.
scopeDefines where in a program a name (like a variable or function) can be accessed.
self (argument)A conventional name for the first argument in instance methods within a class.
sequenceA collection of ordered objects where each object has an associated integer index that defines its position in the sequence.
shallow copyA new object that stores references to the original data from an existing object.
shebang (#!)A line at the top of a script file that names the interpreter to use when the file is executed directly.
sliceAn object that allows you to extract a portion of a sequence, such as a list, tuple, or string.
slicingAn operation that allows you to extract portions of sequences.
snake caseA naming convention where you write compound names joining the words with underscores, using only lowercase letters.
soft keywordA special kind of keyword that retains its meaning only in specific contexts, while in other contexts, it behaves like a regular identifier.
source codeHuman-readable instructions that programmers write to create software.
special methodAnother name for a magic method, the official term used in the Python documentation.
stackA data structure that follows the Last In, First Out (LIFO) principle.
standard libraryA comprehensive collection of pre-written modules and functions that comes bundled with Python itself.
statementA logical instruction that the interpreter can execute.
static methodA method that you define within a class but doesn’t access or use its instance (self) or class (cls).
static type checkerA tool that analyzes your code without executing it to ensure that the types of variables and expressions are consistent with their annotations or type hints.
string literalA piece of source code that represents a string value, written between quotes with optional prefixes such as r, f, b, or t.
triple-quoted stringA string literal enclosed in a pair of triple quotes, either single (''') or double (""").
typeThe classification of a value or object, which determines the kinds of operations that can be performed on it and the ways it can interact with other objects.
type aliasAn alternative name for an existing type.
type hintA syntactic construct that allows you to indicate the expected data types of variables, function arguments, and return values.
UnicodeUnicode is a universal character encoding standard that assigns a unique number (code point) to every character in every language, plus symbols, emojis, and control characters.
universal newlinesA way to handle files with different newline conventions across different platforms.
unpackingPassing multiple values at once by expanding an iterable.
variableA symbolic name that references an object stored in memory.