How does a debugger work?

The details of how a debugger works will depend on what you are debugging, and what the OS is. For native debugging on Windows you can find some details on MSDN: Win32 Debugging API. The user tells the debugger which process to attach to, either by name or by process ID. If it is a … Read more

What does the git index contain EXACTLY?

The Git book contains an article on what an index includes: The index is a binary file (generally kept in .git/index) containing a sorted list of path names, each with permissions and the SHA1 of a blob object; git ls-files can show you the contents of the index: $ git ls-files –stage 100644 63c918c667fa005ff12ad89437f2fdc80926e21c 0 … Read more

Python string interning

This is implementation-specific, but your interpreter is probably interning compile-time constants but not the results of run-time expressions. In what follows CPython 3.9.0+ is used. In the second example, the expression “strin”+”g” is evaluated at compile time, and is replaced with “string”. This makes the first two examples behave the same. If we examine the … Read more