python

Enum vs Flag for bitmasks in Python

Ever wondered what’s behind those funny looking Unix access permission values like 600 ✋, 777 ⚠, or 666 😈? Well, they are octal representations, where each of the three rightmost digits represents a different part of the permissions for owner, group, and others. Each of these digits is created from the sum of its component bits. As a result, specific bits add to the sum as it is represented by a numeral:

Bit

Bit is a Bitcoin library written in Python and was designed from the beginning to feel intuitive, be effortless to use, and have readable source code. It was initially developed by Ofek Lev in 2016. It has since become popular and found new contributors, among which is the excellent Teran McKinney and me. I have been working on adding new features to Bit since 2017. Notable features include: Multi-signature, Segwit, transaction batching, and Mark Erhardt’s Branch-and-Bound coin selection.