4 ms·
> having to __format__ “private” symbols like this, But…that’s not how you format “private” symbols in Python, conventionally; single leading underscore is; do
by dragonwriter 4y ago
> having to __format__ “private” symbols like this,
But…that’s not how you format “private” symbols in Python, conventionally; single leading underscore is; double leading is for identifiers you want mangled with classnames, and double leading and trailing is for special methods.
- Yoric 4y agoIn my book, special methods (aka protocols) are... well, let's say not the most beautiful part of Python. Lot's of poorly documented magic in there.