Shallow and Deep Copy
Assignment shares, a shallow copy duplicates one level, and a deep copy duplicates everything. Choosing the wrong one is one of the most common source...
968 published notes across every category.
Assignment shares, a shallow copy duplicates one level, and a deep copy duplicates everything. Choosing the wrong one is one of the most common source...
Python frees an object the moment nothing refers to it. A second collector exists solely to find reference cycles, which counting alone can never recl...
Compilation, the code object, the stack machine and the frame. A closer look at what the interpreter is actually doing while your program runs.
Processes each run their own interpreter with their own GIL, so they can use every processor core. The cost is that nothing is shared by default.
Asynchronous code runs many waiting tasks in one thread. A coroutine pauses at await, the event loop runs something else, and thousands of tasks becom...
CPython allows only one thread to execute bytecode at a time. That single lock explains why threads help with waiting and never with computation.
A pattern describes a shape of text. Character classes say what, quantifiers say how many, anchors say where, and groups say which part to keep.
Seven functions cover every regex job: search, match, fullmatch, findall, finditer, sub and split. Knowing which one to reach for is most of the skill...
Cleaning, extracting, validating and transforming real text - the jobs regular expressions were made for, worked through end to end.
JSON is the standard way to move structured data between programs. Four functions cover it, and the type mapping has a few asymmetries worth knowing.
pickle stores almost any Python object exactly as it was. It is powerful, Python only, and unsafe on data you did not create yourself.