1/43
Vocabulary flashcards covering Python OOP concepts, SOLID principles, Pythonic practices, decorators, generators, testing methodologies, modularization, and layered architecture.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Object-Oriented Programming (OOP)
A paradigm that organizes code into classes and objects to model real-world entities and behavior.
Class
A user-defined blueprint that bundles data attributes and methods for creating objects.
Object
An instance of a class containing its own state (attributes) and behavior (methods).
Encapsulation
OOP principle that bundles data and methods together while restricting direct access to internal state.
Inheritance
Mechanism that allows a class (child) to acquire attributes and methods of another class (parent).
Polymorphism
Ability for identical method names to behave differently depending on object context.
Compile-Time Polymorphism
Polymorphism resolved at compilation, typically via method or operator overloading.
Run-Time Polymorphism
Polymorphism resolved during execution, usually through method overriding in subclasses.
Abstraction
Hiding internal implementation details while exposing only necessary functionality.
Partial Abstraction
Abstract class containing both abstract and concrete methods.
Full Abstraction
Abstract class (or interface) containing only abstract methods.
Single Responsibility Principle
Each class or function should have one, and only one, reason to change.
Open/Closed Principle
Software entities should be open for extension but closed for modification.
Liskov Substitution Principle
Subtypes must be substitutable for their base types without altering program correctness.
Interface Segregation Principle
Prefer many specific interfaces over one fat interface; clients shouldn’t depend on methods they don’t use.
Dependency Inversion Principle
Depend on abstractions, not concrete implementations; high-level modules shouldn’t depend on low-level details.
DRY (Don’t Repeat Yourself)
Each piece of knowledge should have a single, unambiguous representation in the system.
KISS (Keep It Simple, Stupid)
Favor simple, straightforward solutions and avoid unnecessary complexity.
YAGNI (You Aren’t Gonna Need It)
Implement functionality only when it is actually required.
Zen of Python
A list of 19 aphorisms by Tim Peters guiding Pythonic code style (e.g., “Beautiful is better than ugly”).
Pythonic Principles
Practices emphasizing readability, built-ins, comprehensions, context managers, EAFP, PEP 8, etc.
Decorator
A function (prefixed with @) that takes another function, adds extra behavior, and returns a new function.
Generator
Function that uses yield to lazily produce an iterable sequence, conserving memory.
Decorator vs. Generator
Decorator enhances another function; generator produces values lazily—different purposes though both use functions.
Exception Handling
Using try…except…else…finally blocks to gracefully manage runtime errors.
finally Clause
Part of try-except that always executes, even if an exception occurs or is handled.
Test-Driven Development (TDD)
Development process where tests are written before code, enabling regression prevention and design focus.
Unit (in testing)
Smallest testable piece of code, such as a function or class method.
Mocking
Replacing real dependencies with simulated objects to isolate units during testing.
Integration Testing
Verifies that multiple modules or components interact correctly using real dependencies.
Performance Testing
Assesses system behavior under load, stress, scalability, and endurance conditions.
Load Testing
Measures performance under expected user or transaction volume.
Stress Testing
Evaluates system stability beyond normal operational capacity.
Scalability Testing
Determines how system performance changes as workload increases.
Endurance Testing
Checks system reliability under sustained load over extended periods.
Module
A single Python file (.py) containing variables, functions, or classes for reuse.
Package
A directory containing an init.py file and related modules, enabling hierarchical organization.
init.py
File that marks a directory as a Python package and can execute initialization code.
if name == "main"
Block that runs only when the file is executed directly, not when imported.
Three-Layer Architecture
Separates application into presentation, application (business), and data layers for clarity and scalability.
Presentation Layer
UI layer handling user input/output and formatting without business logic.
Application (Business) Layer
Middle layer containing core processing and mediating between UI and data layers.
Data Layer
Layer responsible for data storage, retrieval, and persistence operations.
Layered Architecture Benefits
Provides faster development, better maintainability, scalability, security, and reliability through clear separation.