Sloth & ENVy
summary
Explains how the process entry from the system V ABI threads a raw envp of null‑terminated strings through libc’s start_main into Python’s posix layer, how os.environ becomes a dictionary hooked to get and put functions, and why mutating env in‑flight breaks binding semantics. Shows a small benchmark where C beats Python on raw lookups but Python’s dict wins at extreme sizes, and draws the practical rule: treat environment vars as immutable props and pass them to child processes rather than mutate them with os.environ vs putenv/getenv.
AI-written summary · about
chapters (11)
- 0:00Sloth & ENVy intro
- 1:03Environment variables in C and Python
- 3:10PATH and which command
- 5:37Disassembling LibC start main
- 7:03Python environ quirks
- 9:31Python vs C env vars
- 10:56Getters and setters in Python
- 12:39Early vs late binding in imports
- 14:25Environment variables and binding
- 15:51Changing env vars at runtime
- 16:55Takeaways and closing thoughts








