Skip to content

Python Glossary

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 import An 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 method A method that is marked with @abstractmethod.
  • annotation A way to attach metadata to function arguments, return values, and variables.
  • application programming interface (API) A set of rules and protocols that allows different software applications to communicate with each other.
  • args (arguments) A special syntax that allows a function to accept an undefined number of positional arguments.
  • argument A value or object that you pass into a function or method when you call it.
  • array A data structure that holds a sequence of objects of the same data type.
  • ASCII ASCII (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.
  • assertion A debugging aid that tests a condition as an internal self-check.
  • assignment An operation that allows you to attach values to variables.
  • assignment expression An assignment that returns a value.
  • asynchronous context manager An object that allows you to allocate resources and release them after running operations that involve asynchronous code.
  • asynchronous generator A function defined with the async def and yield statements that returns an asynchronous generator iterator.
  • asynchronous generator iterator An iterator that produces a series of values over time, where each value is the result of an asynchronous operation.
  • asynchronous iterable An object that you can iterate over asynchronously.
  • asynchronous iteration A powerful feature that allows you to iterate over asynchronous iterators with an async for loop.
  • asynchronous iterator An object that allows you to traverse asynchronous iterables using async for loops.
  • asynchronous programming A programming paradigm where you write code that can handle multiple tasks concurrently without blocking the execution of your program.
  • attribute A value associated with an object that can be accessed using dot notation.
  • awaitable An object that you can pause the execution of a coroutine and wait for the object to complete before resuming the coroutine.
  • base class A base class, also known as a superclass or parent class, is a class from which other classes inherit attributes (data) and behaviors (methods).
  • BDFL Benevolent Dictator For Life, a.k.a. Guido van Rossum, Python’s creator.
  • binary file A type of computer file that stores data in binary format.
  • Boolean A fundamental data type that can have only one of two values: true or false.
  • Boolean flag A variable or function parameter that you set to either True or False.
  • buffer protocol A mechanism in Python that allows objects to share their internal memory buffers with other objects for direct access.
  • bytecode A 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 object Any object that supports the buffer protocol, exposing its underlying binary data efficiently to other objects.
  • callable An object that you can call like a function.
  • callback A function that you pass as an argument to another function that later calls the callback.
  • camel case A 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).
  • class A blueprint for creating objects. It defines attributes as variables and implements behaviors as methods.
  • class method A method that belongs to the class rather than to any specific instance of the class.
  • closure A 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 style Guidelines for writing code in a clear, standardized way that makes it easy to read, understand, and maintain
  • collection A 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.
  • comment Explanatory text that Python ignores when executing code.
  • composition A fundamental concept in object-oriented programming (OOP) that allows you to build composite objects by combining simpler ones.
  • comprehension A concise Python syntax for creating lists, dictionaries, sets, and generator iterators.
  • concatenation The operation of joining two or more strings end-to-end to create a new string.
  • concurrency The ability of a program to manage multiple tasks simultaneously.
  • console The text-based interface used for interacting with your computer’s operating system and running Python programs.
  • context manager An object that allows you to handle a context where you allocate and release resources as needed.
  • control flow The order in which individual statements are executed or evaluated within a Python program.
  • coroutine An object representing a computation that can be paused and resumed.
  • coroutine function A 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 task A task whose execution speed is primarily limited by the speed of the central processing unit (CPU).
  • CPython The reference and official implementation of the Python programming language.
  • data class A special type of class that is mainly used to store data.
  • DataFrame A data structure for working with tabular data in Python.
  • data structure A way of organizing and storing data so that you can access and modify it efficiently.
  • debugging The process of identifying, analyzing, and removing errors or bugs from your code.
  • decorator A callable that takes another callable as an argument and modifies its behavior without modifying its implementation, returning a new callable.
  • deep copy A new object that is a complete, independent clone of the original object.
  • dependency An external package that your project needs in order to run, build, or be developed.
  • descriptor An object that controls an attribute’s behavior when you access, modify, or delete it.
  • dictionary A built-in data type that allows you to store a collection of key-value pairs.
  • dictionary view An object that provides a dynamic view of dictionary keys, values, or items.
  • docstring A string literal that occurs as the first statement in a module, function, class, or method definition and works as documentation.
  • dot notation A syntax that allows you to access attributes and methods of objects.
  • duck typing A programming style where an object is considered compatible with a given type if it has all the methods and attributes that the type requires.
  • dunder See “magic method”
  • dunder method Another name for a magic method, referring to the double underscores in its name.
  • EAFP A coding style that assumes the existence of valid keys, indices, attributes, or methods, and handles exceptions if they aren’t present.
  • encapsulation Involves bundling the data (attributes) and the behavior (methods) that operate on the data into a single entity, typically a class.
  • error See “exception”.
  • escape sequence A series of characters that represents a special character or action inside a string or bytes literal.
  • exception An 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.
  • expression A combination of values, variables, operators, and function calls that can be evaluated to produce a value.
  • f-string A string literal that allows you to interpolate expressions inside strings using curly braces, to produce a formatted string.
  • function A 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 annotation A way to attach type information or type hints to function parameters and return values.
  • garbage collection An automatic memory management feature that reclaims memory occupied by objects no longer used by your program.
  • generator A function that returns a generator iterator, which yields data items on demand, making it memory efficient.
  • generator expression An expression that constructs a generator iterator without the need for a function.
  • generator iterator An 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 function A function composed of multiple implementations of the same operation for different types, where a dispatch algorithm picks the implementation to run.
  • generic type A 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 variable A 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 Rossum The Dutch programmer who created Python and served as its benevolent dictator for life until 2018.
  • hashable An object with a hash value that remains constant during the object’s lifetime.
  • helper function A small function that handles one focused subtask on behalf of other code, keeping the calling function short and readable.
  • higher-order function A function that either takes one or more functions as arguments or returns a function as its result.
  • identifier A name that identifies a variable, function, class, module, or other object.
  • IDLE A lightweight integrated development environment (IDE) that ships with most Python installations.
  • immutable An object whose value can’t be modified after it’s created.
  • import path The path that Python searches to find the modules that you want to import into your code.
  • indentation The use of spaces or tabs at the beginning of a line of code to visually separate and group code blocks.
  • indexing An operation that allows you to access individual items within a sequence.
  • inheritance A 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.
  • instance A concrete occurrence of a class.
  • integrated development environment (IDE) A software application that consolidates essential tools for software development into one graphical user interface.
  • interpreter The program that reads and executes Python code.
  • interpreter shutdown A process that occurs when the Python interpreter terminates, cleaning up resources by closing open files, releasing memory, and calling object destructors.
  • introspection The ability of a program to examine the type or properties of an object at runtime.
  • I/O-bound task A type of computing task that primarily spends its time waiting for input/output (I/O) operations to complete.
  • iterable An 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.
  • iteration The process of repeatedly accessing the items of an iterable, such as a sequence or collection, one at a time.
  • iterator An 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 compiler A 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.
  • LBYL A coding style that emphasizes checking for conditions before executing a particular action.
  • linter A static code analysis tool that examines source code to flag potential errors, bugs, stylistic issues, and suspicious constructs.
  • literal A notation used to represent a fixed value in your code.
  • loader A mechanism responsible for loading a module or package’s code into a Python runtime environment.
  • local variable A variable that you bind inside a function or method body.
  • loop A programming construct that allows you to repeat a block of code multiple times.
  • magic method A method that allows you to define how objects behave with built-in functions and operators.
  • magic number An unnamed numeric literal in your source code that gives no hint of what the value means.
  • mapping A data structure that associates keys with values.
  • metaprogramming The practice of writing code that manipulates or generates other code.
  • method A function that is associated with a particular object or class.
  • method overriding Redefining a method in a subclass when that method has already been defined in the base class.
  • method resolution order (MRO) The order that Python follows to look up attributes and methods in a class hierarchy.
  • mocking A testing technique that replaces real objects with controllable stand-ins so you can isolate code under test and verify how it uses dependencies.
  • module A file containing Python code, which can define functions, classes, variables, and more.
  • mutable An object that allows you to modify its value in place without creating a new object.
  • named tuple A variation of the built-in tuple data type that allows you to create tuple-like objects with items that have descriptive names.
  • name mangling A mechanism that protects class and instance attributes from being accidentally overridden or accessed from outside the class.
  • namespace A container that holds a collection of identifiers, such as variable and function names, and their corresponding objects.
  • namespace package A type of package that allows you to split a single package across multiple directories.
  • nested scope A scope that is defined within another and has the ability to refer to a variable in an enclosing scope.
  • non-blocking operation An operation or task that allows your program to continue executing other tasks without waiting for the operation to complete.
  • non-public name The name of a variable, function, method, or attribute that’s intended for internal use within a module or a class.
  • object A piece of data in memory that has attributes (data) and methods (behaviors).
  • object-oriented programming (OOP) A programming paradigm that organizes code into objects that contain both data and code.
  • operator precedence A set of rules that decides which operators Python evaluates first when an expression contains several of them.
  • package A directory hierarchy that allows you to organize related modules and subpackages.
  • parameter A variable that you use in a function or method definition to accept input values.
  • PEP 8 Python’s official style guide outlining coding conventions for writing clear, readable code that’s consistent with the core Python codebase.
  • pip Python’s default package installer and dependency manager.
  • polymorphism A concept in object-oriented programming (OOP) that allows objects of different classes to be treated the same if they share the same interface.
  • protocol A 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 name Any attribute, method, or variable within a module, class, or object that is intended to be used from outside its immediate scope.
  • PyCon Python programming conferences organized by local communities worldwide.
  • pyproject.toml A configuration file at the root of a Python project that declares its build system, metadata, and dependencies in TOML format.
  • PyPy An alternative implementation of Python that uses a just-in-time compiler to run pure-Python code faster than CPython.
  • Python A 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.
  • Pythonic An approach or style of writing code that aligns with Python’s philosophy and idioms.
  • pythonista A Python programmer who uses the language regularly and enthusiastically, writes Pythonic code, and takes part in the Python community.
  • python.org The official website for the Python programming language.
  • Python Package Index (PyPI) The default Package Index for the Python programming language.
  • Python Software Foundation (PSF) A non-profit organization dedicated to advancing and promoting the Python programming language.
  • Python Steering Council A small group elected to oversee the development and direction of the Python programming language.
  • queue A data structure that follows the First-In-First-Out (FIFO) principle.
  • raw string A string that treats backslashes (``) as literal characters without their usual special meaning in escape sequences.
  • recursion A programming technique that consists of a function calling itself in order to solve a problem.
  • reference count A mechanism used by the interpreter to manage memory allocation and deallocation for objects.
  • relative import Import modules from the same package or parent packages using leading dots.
  • release candidate A pre-release version of Python that becomes the final release unless critical bugs are found in testing.
  • REPL An 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.txt A plain text file that lists the packages a project needs, so pip can install them all with a single command.
  • scope Defines 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.
  • sequence A collection of ordered objects where each object has an associated integer index that defines its position in the sequence.
  • shallow copy A 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.
  • slice An object that allows you to extract a portion of a sequence, such as a list, tuple, or string.
  • slicing An operation that allows you to extract portions of sequences.
  • snake case A naming convention where you write compound names joining the words with underscores, using only lowercase letters.
  • soft keyword A special kind of keyword that retains its meaning only in specific contexts, while in other contexts, it behaves like a regular identifier.
  • source code Human-readable instructions that programmers write to create software.
  • special method Another name for a magic method, the official term used in the Python documentation.
  • stack A data structure that follows the Last In, First Out (LIFO) principle.
  • standard library A comprehensive collection of pre-written modules and functions that comes bundled with Python itself.
  • statement A logical instruction that the interpreter can execute.
  • static method A method that you define within a class but doesn’t access or use its instance (self) or class (cls).
  • static type checker A 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 literal A piece of source code that represents a string value, written between quotes with optional prefixes such as r, f, b, or t.
  • string representation The way Python represents objects as strings.
  • subclass A class that inherits attributes and methods from another class, which is known as the base class or parent class.
  • test suite A collection of test cases grouped so that a test runner can execute them together and report a single pass or fail result.
  • text encoding The conversion of text data into a specific format that computers can store and manipulate.
  • text file A type of computer file that contains plain text.
  • thread A separate flow of execution within a program.
  • traceback Python’s report showing the function call stack when an exception or error is raised.
  • transitive dependency An indirect requirement of your project.
  • triple-quoted string A string literal enclosed in a pair of triple quotes, either single (''') or double (""").
  • type The 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 alias An alternative name for an existing type.
  • type hint A syntactic construct that allows you to indicate the expected data types of variables, function arguments, and return values.
  • Unicode Unicode 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 newlines A way to handle files with different newline conventions across different platforms.
  • unpacking Passing multiple values at once by expanding an iterable.
  • variable A symbolic name that references an object stored in memory.
  • variable annotation A syntax for attaching type hints to variables.
  • virtualenv Common shorthand for a Python virtual environment.
  • virtual environment A directory tree that provides an isolated runtime environment on top of an existing Python installation.
  • virtual machine (VM) The component of the Python interpreter that executes your Python code.
  • walrus operator Another name for Python’s assignment expression, the := operator.
  • wheel Pre-built, ready-to-install distribution format for faster and more reliable Python package installation.
  • whitespace A character that represents blank space in text, used in Python for indentation and string processing.
  • wildcard import An import uses the star syntax to pull many names into your current namespace at once.
  • Zen of Python A collection of guiding principles for writing Python code.