PCPP1 study plan
PCPP1 · Give each week a clear focus.
8 weeks · About 6 hours per week
Advanced OOP
Implement at least six classes that use dunder methods (init, repr, str, eq, hash, len, getitem, iter) and explain in comments what each method changes for callers
Write a small inheritance hierarchy that demonstrates cooperative multiple inheritance with super() and method resolution order, then predict and verify the MRO of three example classes
Demonstrate class, static, and instance methods plus class attributes versus instance attributes, including a case where a mutable class attribute causes a shared-state bug
Implement property getters, setters, and deleters with validation, and compare them against manual get_x/set_x methods
Build a custom exception hierarchy rooted in Exception and raise it from at least two call sites with informative messages
Your checkpoint
A runnable module of roughly 200 lines with a short README listing each dunder method used, the observed MRO output, and one bug you fixed from shared mutable class state
Advanced OOP
Implement getattr, setattr, and getattribute in a proxy or lazy-loading class and document the order in which Python resolves attribute access
Write a descriptor class (get, set, set_name) and use it to validate attributes on two different classes
Create a class using slots and measure the memory difference against an equivalent dict-based class with sys.getsizeof or tracemalloc
Make a class iterable and context-manager capable by implementing iter, next, enter, and exit with proper cleanup
Refactor one earlier class to use dataclasses or init_subclass and note which boilerplate disappeared
Your checkpoint
A descriptor-based validation mini-library with tests that prove invalid assignments raise, plus a short written comparison of getattr versus getattribute pitfalls
Best Practices and Standardization
Apply PEP 8 naming, layout, and import ordering to an existing script and record every change
Write type hints for all public functions in one project and run mypy or pyright in strict mode on it, fixing every reported error
Add docstrings in a consistent style (Google or NumPy) to every public function and verify them with pydoc
Configure a linter and formatter (flake8 or ruff plus black) with a pyproject.toml or setup.cfg and run them cleanly
Explain in writing when to raise ValueError versus TypeError versus a custom exception, with one code example each
Your checkpoint
A small package that passes a strict type checker and linter with zero warnings, committed with the configuration file and a before/after diff summary
Best Practices and Standardization & Advanced OOP
Write pytest unit tests covering normal, boundary, and error paths for the week-2 descriptor library, aiming above 85 percent line coverage
Use fixtures, parametrize, and tmp_path in at least three tests, and separate fast unit tests from slower integration tests with markers
Profile a CPU-bound function with cProfile and optimize it, documenting the before/after timing
Demonstrate a generator pipeline that processes a large file line by line and compare peak memory with a list-based version
Identify and fix a mutable default argument bug and a late-binding closure bug in sample code
Your checkpoint
A test suite that runs green with a coverage report attached, plus a one-page performance note showing profiler output and the measured speedup
Working with RESTful APIs
Send GET, POST, PUT, PATCH, and DELETE requests with the requests library against a public test API and log status codes and headers
Handle query parameters, path parameters, JSON bodies, and custom headers including an API key read from an environment variable
Implement timeout, retry with backoff, and explicit handling of 4xx versus 5xx responses
Parse nested JSON responses into typed Python objects and serialize them back
Compare requests with http.client or urllib for one call and note the tradeoffs
Your checkpoint
A reusable API client module with a CLI entry point that performs a full create-read-update-delete cycle and prints a formatted summary of each response
Working with RESTful APIs
Implement OAuth2 client-credentials or bearer-token authentication in the client and keep secrets out of source control
Add pagination handling that follows next-page links or offsets until exhausted
Write integration tests against a mocked HTTP layer using responses or unittest.mock, covering success, timeout, and 429 paths
Handle rate limiting with respect for Retry-After and add structured logging of request IDs
Document the API contract you depend on, including status codes and error body shapes
Your checkpoint
An extended client with auth, pagination, retries, and a passing mocked test suite, plus a short API contract document
GUI Programming
Build a Tkinter window with a grid layout containing labels, entry fields, buttons, and a listbox wired to callbacks
Bind at least three events (button click, key press, window close) and implement clean shutdown with protocol handlers
Connect the GUI to the week-6 API client and run network calls off the main thread so the interface stays responsive
Add input validation with user-facing error dialogs and disable buttons during in-flight requests
Package the application so it launches from a single entry point with a documented dependency list
Your checkpoint
A working desktop client that fetches, displays, and creates records through the API, with a screenshot-free README describing the layout and the threading approach
GUI Programming & Advanced OOP & Best Practices and Standardization & Working with RESTful APIs
Refactor the GUI application to use an OOP structure with separate view, controller, and API-service classes
Add at least five new tests covering the controller logic and the API service with mocked responses
Run the full linter, formatter, and strict type checker across the whole project and resolve all findings
Complete two timed mixed-domain practice sets and review every missed item by writing the correct rule in your own words
Write a one-page cheat sheet covering dunder methods, MRO, descriptors, typing, testing, requests error handling, and Tkinter event binding
Your checkpoint
A final integrated project repository with green tests, clean static analysis, and a personal cheat sheet you can review in the last 48 hours
Milestones
Week 2: You can explain without notes the difference between __getattr__ and __getattribute__, predict a class MRO, and write a working descriptor from scratch
Week 4: Your project passes a strict type checker and linter and has a green test suite with coverage above 85 percent
Week 6: Your API client survives mocked timeouts, 4xx, 5xx, and 429 responses and handles pagination to completion
Week 8: The integrated GUI application runs end to end, all static analysis is clean, and you score above 80 percent on both timed practice sets