The notebook index
Post archive
5 posts in Python and Haskell.
- A virtual environment has an interpreter boundary
A Python virtual environment is selected by the interpreter that runs your program. Learn how pyvenv.cfg, interpreter prefixes, shell activation, and python -m pip reveal which environment owns installed packages.
- Make an invalid state unrepresentable at the interface
A result type makes success and failure explicit in a function’s interface. In Haskell, Either lets callers distinguish failures by constructor while still requiring validation at untrusted input boundaries.
- Read the ownership boundary before upgrading an RPC binding
Before upgrading a Haskell Cap’n Proto binding, separate schema-generated types, message data ownership, serialization, and RPC behavior. Then check project status, protocol assumptions, and the API changes an upgrade may introduce.
- Why len(x) is not just x.__len__() in disguise
Implicit operations such as len use a type-level special method protocol, which differs from ordinary attribute lookup on an instance.
- A Python name is a binding, not a box containing a copy
Python assignment binds names to objects, so mutating a shared list is visible through every alias while rebinding one name changes only that binding.