Code Quality: PEP 8, Docstrings and Clean Code
Code is read far more often than it is written. Consistent style, honest names and clear structure are what make the second reading cheap.
A complete core Python path: syntax, data types, operators, strings, control flow, collections, functions, exceptions, files, modules, the standard library, OOP, iterators, generators, decorators, internals, concurrency, regular expressions, testing, typing, performance, security, problem solving, projects, interview preparation and exams.
110 notes in 33 topics
Code is read far more often than it is written. Consistent style, honest names and clear structure are what make the second reading cheap.
Annotations describe what a function expects and returns. Python does not enforce them, and that is the point: they are documentation a tool can check...
Type variables let one function work with any type while keeping the relationship between input and output. Protocol describes a shape, and TypedDict...
Big-O describes how work grows with input size. Choosing the right container is worth more than every micro-optimisation combined.
Measure before optimising. Guessing where a program spends its time is wrong often enough that the habit is worth breaking permanently.
Once the algorithm is right, a handful of techniques reliably help: build less, look up less, let C do the loop, and cache what repeats.
Most security problems come from trusting input, trusting paths and storing secrets in the wrong place. Each has a standard, boring, correct answer.
eval, exec, shell commands, string built queries and pickle all take text and turn it into action. Each has a safe alternative that costs almost nothi...
Linear search checks everything; binary search halves the problem each step. Knowing when the second is possible is worth more than either implementat...
Python sorts for you in n log n. Implementing bubble, insertion, merge and quick sort is still worth doing, because it teaches how algorithms are comp...
Three linear structures defined by where you may add and remove items. Python gives you two of them almost for free; the third is worth building once.
A dictionary turns "have I seen this?" and "how many of these?" from an O(n) scan into an O(1) lookup. That single change solves a large share of inte...