vivis vivis avatar dev

> thoughts on AI, code, and everything in between

Python Koans #

Python lessons wrapped in koans. Small puzzles, deep truths. Not your usual tutorial thread. Cross-posted from https://pythonkoans.substack.com

Exploring traps in try/finally blocks, and the reasoning behind PEP601 and PEP765

On the fragility of unintended behavior and the wisdom of explicit paths

Exploring the pitfalls of raw string literals in Python

A look into Python's regex module

Experience is simply the name we give our mistakes - Oscar Wilde

Why we need "if __name__ == '__main__'"

Understanding Unicode equivalence and the deceptive nature of glyphs

When distributing python package_data goes wrong

Understanding Python dataclasses and how fields determine equality and hashing.

Exploring the dangerous power of unquoted Python strings, and how they caused CVE-2024-9287

Understanding how Python's list comprehensions work under the hood

Understanding how Python's list comprehensions work under the hood

Exploring chained operations and order of evaluation in python expressions

Understanding Python’s rules for hashing

Navigating Python's import system and namespace packages

Understanding Late Binding in Python Closures

Exploring how functions in Python are treated as first-class citizens, and the untapped potential they hold.

Understanding Python’s LEGB rule, closures, and how names echo through nested functions

Understanding how Python evaluates default arguments and why mutable defaults can carry unintended memory

Understanding the difference between identity and equality, and why it matters more than it seems.

Understanding truthiness, falsiness, and the quiet meaning of emptiness in Python