1/51
A comprehensive set of vocabulary flashcards derived from lecture notes covering Python language mechanics, algorithms, databases, and functional programming concepts.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
dir()
A built-in function that returns a list of identifiers defined in the current scope.
name
A module attribute that evaluates to "main" when the module is executed directly.
globals()
A function that returns a dictionary representing the current module's globally accessible attributes.
locals()
A function that returns a dictionary containing variables restricted to the local scope, such as parameters inside a function.
LEGB Rule
The sequence Python uses to resolve name references: Local, Enclosing, Global, and Built-in.
Shadowing
A situation where a local variable is defined with the same name as a global variable, causing the local variable to take precedence in that scope.
dict
An internal dictionary used by objects to store their data attributes.
mappingproxy
The structure of a class dictionary that contains methods, class-level attributes, and special built-in data like module and doc.
@staticmethod
A decorator used for methods that are called on a class rather than an object and do not receive an automatic self parameter.
@classmethod
A decorator for methods that are called on the class as a whole and automatically receive the class itself (conventionally named cls) as the first parameter.
Factory Methods
Methods used to provide descriptive, alternative ways to instantiate objects, often implemented as class methods.
Positional Arguments
Arguments matched to parameters based strictly on the order in which they are provided.
Keyword Arguments
Arguments matched to parameters explicitly by their names.
Mutable Default Trap
A naming for the issue where mutable objects used as default arguments persist mutations across future function calls because they are stored within the function object itself.
*args (Tuple-Packing)
A parameter that packs any varying number of leftover positional arguments into a single tuple.
**kwargs (Dictionary-Packing)
A parameter that packs all leftover keyword arguments into a dictionary; it must be the last parameter in the function signature.
Keyword-Only Parameters
Parameters placed after a bare * in a definition that must be passed by name.
Positional-Only Parameters
Parameters placed to the left of a / in a definition that cannot be passed as keyword arguments.
Syntactic Sugar
Cleaner or automated syntax, such as the with statement, provided for handling setup and teardown actions.
Context Management Protocol
The requirement that an object must implement the enter and exit methods to be used in a with statement.
Asymptotic Analysis
The measurement of the growth rate of an algorithm's resource usage (time or memory) as the problem size n approaches infinity.
O-Notation (Big-O)
A formal notation where g(n) serves as an upper bound for the growth rate of a function f(n), ignoring small problem sizes and constant speed factors.
Space Complexity
The measurement of memory growth as the problem size increases; for example, a standard Python list storing n items has a space complexity of O(n).
Sequential (Linear) Search
A searching algorithm that checks elements one by one, with a worst-case time complexity of O(n), best used for unsorted lists.
Binary Search
A searching algorithm for sorted lists that halves the search space at every step, resulting in a worst-case time complexity of O(log(n)).
Scalar Value
A value in a database column that cannot be broken down into smaller, separately meaningful pieces.
Primary Key
A column or combination of columns that uniquely identifies every row in a table.
Foreign Key
A column that stores the primary key of a row from another table to establish a relationship between the two.
Referential Integrity
A database constraint enforcing that a foreign key must refer to a row that actually exists in the linked table.
Injection Attack
A security threat where malicious users inject arbitrary SQL commands into formatted SQL strings via user input.
Transaction
A sequence of database operations treated as a single "all-or-nothing" unit to maintain data consistency.
Hashability
The requirement for an object to support the hash and eq methods so it can be stored in sets or as dictionary keys.
Generator Expression
A syntax resembling a list comprehension but using parentheses, which creates a generator that produces values lazily.
Iterable
An object, such as a list or string, that can produce a sequence of values one at a time using the iter method.
Iterator
A separate, temporary object that manages the state of a single, ongoing iteration by implementing next and iter methods.
Generator Function
A function containing at least one yield statement that returns a generator object and executes in "fits and starts."
yield from
A statement used to easily yield every element from an iterable one at a time within a generator.
Truthiness
The evaluation of objects as true or false in conditional contexts using a fallback process involving bool and len.
Sequence Protocol
A protocol where a class implements both len and getitem (for non-negative integers), automatically granting it iterability and reverse iteration.
Reflected Operators
Methods like radd that Python calls on the right-hand operand if the left-hand operand does not support a binary operation.
Liskov Substitution Principle
A principle stating that derived classes should be safely substitutable for their base classes.
Method Resolution Order (MRO)
The linearized order, determined by the C3 algorithm, in which base class dictionaries are searched for attributes in multiple inheritance.
RecursionError
The exception raised by Python when a recursive function reaches the run-time stack limit, often due to a missing base case.
Tail Call
A function call that occurs as the absolute last step of a function, returning the result without any additional work.
Memoization
A technique of storing the results of previous function calls to avoid redundant calculations, improving time complexity in recursion.
Dynamic Programming
A bottom-up approach to solving recursively shaped problems by starting at the base cases and building forward iteratively.
First-Class Functions
Functions treated as values that can be assigned to variables, passed as arguments, and returned as results.
Higher-Order Function
A function that accepts other functions as arguments, returns them as results, or both.
Lambda Expression
An anonymous, unnamed function defined in a single expression that can support positional and keyword arguments.
Decorator
A function that accepts another function as an argument and returns a replacement function to extend or modify its behavior.
Abstract Base Class (ABC)
A class that defines a protocol or set of requirements that must be implemented by any concrete subclass, inherited from abc.ABC.
Virtual Subclassing
The process of using ABCName.register(ClassName) to instruct Python to treat a class as if it implements an ABC's protocol without actual inheritance.